pyrlang.gen.decorators

Decorator funcitons for building Gen based classes.

the functions call, cast, info are function decorators.

If you need to overrdide for extra functionality you probably want to use the classes CallDecorator, CastDecorator, InfoDecorator instead

pyrlang.gen.decorators.async_wrapper_factory(fun)

A coroutine function that calls the plain function fun.

class pyrlang.gen.decorators.HandleDecorator(order, pattern=None)

Bases: object

Base class for handler Decorators, don’t use directly

handler_type: str | None = None
class pyrlang.gen.decorators.CallDecorator(order, pattern=None)

Bases: HandleDecorator

handle_call decorator, decorate functions that should be part of the handle_call matching

handler_type: str | None = 'call'
pyrlang.gen.decorators.call(*args, **kwargs)

wrapper function around the CallDecorator class

class pyrlang.gen.decorators.CastDecorator(order, pattern=None)

Bases: HandleDecorator

handle_cast decorator, decorate functions that should be part of the handle_cast matching

handler_type: str | None = 'cast'
pyrlang.gen.decorators.cast(*args, **kwargs)

wrapper function around the CastDecorator class

class pyrlang.gen.decorators.InfoDecorator(order, pattern=None)

Bases: HandleDecorator

handle_info decorator, decorate functions that should be part of the handle_info matching

handler_type: str | None = 'info'
pyrlang.gen.decorators.info(*args, **kwargs)

wrapper function around the InfoDecorator class