Toloka documentation

register

toloka.streaming.pipeline.Pipeline.register | Source code

register(self, observer: BaseObserver)

Register given observer.

Parameters Description

Parameters Type Description
observer BaseObserver

Observer object.

  • Returns:

    The same observer object. It's usable to write one-liners.

  • Return type:

    BaseObserver

Examples:

Register observer.

observer = SomeObserver(pool_id='123')
observer.do_some_preparations(...)
toloka_loop.register(observer)

One-line version.

toloka_loop.register(SomeObserver(pool_id='123')).do_some_preparations(...)