Source

callchain / callchain / queue / lazyauto / chainlet.py

Full commit
# -*- coding: utf-8 -*-
'''lazy auto-balanced chainlets'''

from appspace import key
from knife.lazy import OutMixin

from callchain.queue import keys
from callchain.chainlet.base import Chainlet
from knife.mixins import (
    RepeatMixin, MapMixin, CmpMixin, SliceMixin, FilterMixin, OrderMixin,
    MathMixin, ReduceMixin)


class chainlet(Chainlet, OutMixin):

    '''chainlet'''


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

    '''repeat chainlet'''


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

    '''mapping chainlet'''


@key(keys.KCollect)
class cmplet(Chainlet, OutMixin, CmpMixin):

    '''collecting chainlet'''


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

    '''slicing chainlet'''


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

    '''filtering chainlet'''


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

    '''ordering chainlet'''


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

    '''mathing chainlet'''


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

    '''reducing chainlet'''