Source

callchain / callchain / root / activeman.py

Full commit
# -*- coding: utf-8 -*-
'''active manually balanced chains'''

from appspace import key
from twoq.active import ManResultMixin

from callchain.route import Chains, Events
from callchain.mixin import ChainMixin, PriorityMixin, EventMixin

from callchain.root.settings import Defaults
from callchain.root.keys import KRoot, KEventRoot
from callchain.root.core import RootMixin, EventRootMixin
from callchain.root.apps import thingchain, thingevent, chain, events

thingchain = Chains(thingchain).defaults(Defaults)
thingevent = Events(thingevent).events(events).defaults(Defaults)


@key(KRoot)
@thingchain
class callchain(RootMixin, ChainMixin, ManResultMixin):

    '''active queued manually balanced lite call chain'''


@key(KRoot)
@thingchain
class prioritychain(RootMixin, PriorityMixin, ManResultMixin):

    '''active priority queued manually balanced lite call chain'''


@key(KEventRoot)
@thingevent
class eventchain(EventRootMixin, EventMixin, ManResultMixin):

    '''active queued manually balanced lite event chain'''


class chainqueue(chain):
    prefix = 'callchain.chainlet.activeman.chainlet'


class eventqueue(chain):
    prefix = 'callchain..chainlet.activeman.eventlet'
    chain = 'callchain.chainlet.activeman.chainlet.chainlink'


chain = Chains(chainqueue).defaults(Defaults)
event = Events(eventqueue).events(events).defaults(Defaults)


@key(KRoot)
@chain
class chainq(RootMixin, ChainMixin, ManResultMixin):

    '''active queued manually balanced call chain'''


@key(KRoot)
@chain
class priorityq(RootMixin, PriorityMixin, ManResultMixin):

    '''active priority queued manually balanced lite call chain'''


@key(KEventRoot)
@event
class eventq(EventRootMixin, EventMixin, ManResultMixin):

    '''active queued manually balanced event chain'''