Source

callchain / callchain / queue / lazyauto / eventlet.py

Full commit
# -*- coding: utf-8 -*-
'''lazy auto-balancing eventlets'''

from appspace import key
from twoq.lazy import AutoQMixin
from twoq.mapping import DelayMixin, RepeatMixin, MapMixin
from twoq.reducing import MathMixin, TruthMixin, ReduceMixin
from twoq.ordering import RandomMixin, OrderMixin, CombineMixin
from twoq.filtering import FilterMixin, CollectMixin, SetMixin, SliceMixin

from callchain.queue import keys
from callchain.chainlet.base import Eventlet


class eventlet(Eventlet, AutoQMixin):

    '''eventlet'''


@key(keys.KDelay)
class delaylet(Eventlet, AutoQMixin, DelayMixin):

    '''delayed mapping eventlet'''


@key(keys.KRepeat)
class repeatlet(Eventlet, AutoQMixin, RepeatMixin):

    '''repeat eventlet'''


@key(keys.KMap)
class maplet(Eventlet, AutoQMixin, MapMixin):

    '''mapping eventlet'''


@key(keys.KCollect)
class collectlet(Eventlet, AutoQMixin, CollectMixin):

    '''collecting eventlet'''


@key(keys.KSet)
class setlet(Eventlet, AutoQMixin, SetMixin):

    '''seting eventlet'''


@key(keys.KSlice)
class slicelet(Eventlet, AutoQMixin, SliceMixin):

    '''slicing eventlet'''


@key(keys.KFilter)
class filterlet(Eventlet, AutoQMixin, FilterMixin):

    '''filtering eventlet'''


@key(keys.KRandom)
class randomlet(Eventlet, AutoQMixin, RandomMixin):

    '''randomizing eventlet'''


@key(keys.KOrder)
class orderlet(Eventlet, AutoQMixin, OrderMixin):

    '''ordering eventlet'''


@key(keys.KMath)
class mathlet(Eventlet, AutoQMixin, MathMixin):

    '''mathing eventlet'''


@key(keys.KReduce)
class reducelet(Eventlet, AutoQMixin, ReduceMixin):

    '''reducing eventlet'''


@key(keys.KCombine)
class combinelet(Eventlet, AutoQMixin, CombineMixin):

    '''combining eventlet'''


@key(keys.KTruth)
class truthlet(Eventlet, AutoQMixin, TruthMixin):

    '''truthing eventlet'''