Skip to content

S3tsvreader

S3TSVReader

S3TSVReader(bucket: Bucket, key: str, fields: Sequence[LogFieldRec])

Tails a TSV file stored as an S3 Express object.

crashed property

crashed: bool

Does the reader appear to have crashed?

running property

running: bool

Does the reader appear to be running?

start

start(*, force: bool = False) -> None

Start or restart the log reader.

stop

stop() -> None

Stops the log reader. Note that, unlike S3TSVWriter, there is no expectation that the log reader will drain the queue during stop: stop() is intended to just stop. This is because, in expected use, stop() should be called when subsequent reads from the log would have no effect on behavior; i.e., the consumer of the log information has already received a shutdown instruction, completed its work, entered an invalid state, etc.

update

update() -> bool

Check if any log entries have been retrieved asynchronously, and, if so, write them into self.logbuf, concatenate them to self.log, and assign them to self.last_log.

Note: clears self.logtail on execution.

Returns:

  • bool

    True if there are any new log entries, False if not.