bucket API

One of the fundamental blocks for moving data to the client comes in the form of the bucket brigade (See the section called brigade API). The brigade is simply an ordered list of buckets.

is_eos

Synopsis

bucket.is_eos()

Description

This integer attribute indicates whether or not the bucket is an EOS (end of stream) bucket. If is_eos is true, the bucket is EOS, otherwise it is a regular bucket.

name

Synopsis

bucket.name()

Description

This string attribute gives the internally defined name of the bucket type.

length

Synopsis

bucket.length()

Description

This integer attribute contains the length of the data stored in the bucket. It can equal -1, indicating that the length of the data cannot be determined until it is read. Values other than -1 indicate the length of the data that will be read. If length is -1, bucket data must be read until None is returned.

read

Synopsis

bucket.read( block)

Arguments

Description

This is the main routine for transferring data from the bucket to the caller. If the block parameter is given, this routine will block until the data has been read. If the bucket's length is -1 this routine will return None when there is no more data to be read.