Source

callchain / callchain / root / lazyman.py

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

from appspace import key
from twoq.lazy import ManResultMixin

from callchain.key.mixin import KEvent

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

from callchain.root.settings import Defaults
from callchain.root.keys import KRootResults
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(KRootResults)
@thingchain
class callchain(RootMixin, ChainMixin, ManResultMixin):

    '''lazy queued manually balanced lite call chain'''


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

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


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

    '''lazy queued manually balanced lite event chain'''


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


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


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


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

    '''lazy queued manually balanced call chain'''


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

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


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

    '''lazy queued manually balanced event chain'''