callchain / callchain / root / lazyauto.py

# -*- coding: utf-8 -*-
'''lazy auto-balancing root chains'''

from appspace import key
from twoq.lazy import AutoResultMixin

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, AutoResultMixin):

    '''lazy queued auto-balancing lite call chain'''


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

    '''lazy priority queued auto-balancing lite call chain'''


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

    '''lazy queued auto-balancing lite event chain'''


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


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


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


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

    '''lazy queued auto-balancing call chain'''


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

    '''lazy priority queued auto-balancing lite call chain'''


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

    '''lazy priority queued auto-balancing lite call chain'''
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.