stream_tap Package

stream_tap Package

class stream_tap.Bucket(func)

Bases: object

Encloses a function that produces results from an item of an iterator, accumulating any results in a deque.

contents()
Returns:contents
drain_contents()

Starts a new collection to accumulate future contents and returns all of existing contents.

stream_tap.stream_tap(callables, stream)

Calls each callable with each item in the stream. Use with Buckets. Make a Bucket with a callable and then pass a tuple of those buckets in as the callables. After iterating over this generator, get contents from each Spigot.

Parameters:
  • callables – collection of callable.
  • stream – Iterator if values.

_meta Module