Source

callchain / callchain / queue / lazyman / chainlet.py

# -*- coding: utf-8 -*-
'''lazy manually balanced chainlets'''

from appspace import key
from twoq.lazy import ManQMixin
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 Chainlet


class chainlet(Chainlet, ManQMixin):

    '''chainlet'''


@key(keys.KDelay)
class delaylet(Chainlet, ManQMixin, DelayMixin):

    '''delayed mapping chainlet'''


@key(keys.KRepeat)
class repeatlet(Chainlet, ManQMixin, RepeatMixin):

    '''repeat chainlet'''


@key(keys.KMap)
class maplet(Chainlet, ManQMixin, MapMixin):

    '''mapping chainlet'''


@key(keys.KCollect)
class collectlet(Chainlet, ManQMixin, CollectMixin):

    '''collecting chainlet'''


@key(keys.KSet)
class setlet(Chainlet, ManQMixin, SetMixin):

    '''seting chainlet'''


@key(keys.KSlice)
class slicelet(Chainlet, ManQMixin, SliceMixin):

    '''slicing chainlet'''


@key(keys.KFilter)
class filterlet(Chainlet, ManQMixin, FilterMixin):

    '''filtering chainlet'''


@key(keys.KRandom)
class randomlet(Chainlet, ManQMixin, RandomMixin):

    '''randomizing chainlet'''


@key(keys.KOrder)
class orderlet(Chainlet, ManQMixin, OrderMixin):

    '''ordering chainlet'''


@key(keys.KMath)
class mathlet(Chainlet, ManQMixin, MathMixin):

    '''mathing chainlet'''


@key(keys.KReduce)
class reducelet(Chainlet, ManQMixin, ReduceMixin):

    '''reducing chainlet'''


@key(keys.KCombine)
class combinelet(Chainlet, ManQMixin, CombineMixin):

    '''combining chainlet'''


@key(keys.KTruth)
class truthlet(Chainlet, ManQMixin, TruthMixin):

    '''truthing chainlet'''