Generators

Write me.

kaa.generator(generic=False)

This decorator is used to construct asynchronous generators, to be used in combination with functions that return InProgress objects (such as those functions decorated with @:func:kaa.coroutine or @:func:kaa.threaded).

Parameters:
  • generic – if True, a Generator object is passed as the first argument to the decorated function. This can be used for functions which have not been previously decoratored with a supported decorator (such as @coroutine or @threaded).

class kaa.Generator

Generator for InProgress objects

Synopsis

Class Hierarchy

kaa.Generator

Methods
finish()Finish the generator, the result will be ignored
send()Send a new value (producer)
throw()Throw an error, this will stop the generator

Methods

finish(result)
Finish the generator, the result will be ignored
send(result, exception=False)
Send a new value (producer)
throw(type, value, tb)
Throw an error, this will stop the generator

Previous topic

Thread Support

Next topic

Remote Procedure Calls with kaa.rpc

This Page

Quick search