Package kenozooid :: Module flow

Module flow

source code

Kenozooid data flow processing functions and coroutines.
Functions
 
coroutine(func)
Decorator for a coroutine function.
source code
 
pipe(data, *gens)
Pipe data through list of generators.
source code
 
send(data, tc)
Send data from iterator to target coroutine.
source code
 
split(*args, **kwargs)
Coroutine to receive a value and send it to all coroutines specified in tc list.
source code
 
concat(*args, **kwargs)
Coroutine to concatenate data from n sources.
source code
 
sink(*args, **kwargs)
A sink coroutine to receive a value and execute with function f.
source code
 
buffer(*args, **kwargs)
Coroutine buffer, which stores received data in a file.
source code
 
buffer_open(*args, **kwds)
Open n buffer files.
source code
Variables
  __package__ = 'kenozooid'
Function Details

coroutine(func)

source code 

Decorator for a coroutine function.

Advances a coroutine to its first (yield) statement.

pipe(data, *gens)

source code 
Pipe data through list of generators.
Parameters:
  • data - Data to pipe through the generators.
  • gens - List of generators to process the data.

send(data, tc)

source code 
Send data from iterator to target coroutine.
Parameters:
  • data - Iterator of data to send.
  • tc - Coroutine to receive the data.

split(*args, **kwargs)

source code 
Coroutine to receive a value and send it to all coroutines specified in tc list.
Parameters:
  • tc - List of target coroutines.
Decorators:
  • @coroutine

concat(*args, **kwargs)

source code 

Coroutine to concatenate data from n sources.

The coroutines receives n sources of data and passes them to cat function. The concatenate result is sent to tc target coroutine.

Parameters:
  • n - Amount of data sources.
  • cat - Function to concatenate data.
  • tc - Target coroutine.
Decorators:
  • @coroutine

sink(*args, **kwargs)

source code 
A sink coroutine to receive a value and execute with function f.
Decorators:
  • @coroutine

buffer(*args, **kwargs)

source code 

Coroutine buffer, which stores received data in a file.

When coroutine is closed, then file object is sent to target coroutine.

Parameters:
  • f - File object to store buffered data.
  • tc - Target coroutine.
Decorators:
  • @coroutine

buffer_open(*args, **kwds)

source code 
Open n buffer files.
Decorators:
  • @contextmanager