plainbox.impl.result – job result

This module has two basic implementation of IJobResult: MemoryJobResult and DiskJobResult.

class plainbox.impl.result.DiskJobResult(data)[source]

A IJobResult that keeps IO logs on disk.

This type of JobResult is intended for working with most results. It does not store IO logs in memory so it is scalable to arbitrary IO log sizes. Each instance just knows where the log file is located (using the ‘io_log_filename’ attribute for that) and offers streaming API for accessing particular parts of the log.

get_io_log()[source]
io_log[source]
io_log_filename[source]

pathname of the file containing serialized IO log records

class plainbox.impl.result.GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)[source]

Subclass of GzipFile that works around missing read1() on python3.2

See: http://bugs.python.org/issue10791

read1(n)[source]
class plainbox.impl.result.IOLogRecord

IOLogRecord(delay, stream_name, data)

data

Alias for field number 2

delay

Alias for field number 0

stream_name

Alias for field number 1

class plainbox.impl.result.IOLogRecordReader(stream)[source]

Class for streaming :class`IOLogRecord` instances from a text stream

close()[source]
read_record()[source]

Read the next record from the stream.

Returns:None if the stream is empty
Returns:next IOLogRecord as found in the stream.
class plainbox.impl.result.IOLogRecordWriter(stream)[source]

Class for writing IOLogRecord instances to a text stream

close()[source]
write_record(record)[source]

Write an IOLogRecord to the stream.

class plainbox.impl.result.MemoryJobResult(data)[source]

A IJobResult that keeps IO logs in memory.

This type of JobResult is indented for writing unit tests where the hassle of going through the filesystem would make them needlessly complicated.

get_io_log()[source]

Previous topic

plainbox.impl.resource – job resources

Next topic

plainbox.impl.runner – job runner

This Page