Metadata-Version: 1.1
Name: basicevents
Version: 1.0.2
Summary: python events non-blocking
Home-page: https://github.com/kianxineki/basicevents
Author: Alberto Galera Jimenez
Author-email: galerajimenez@gmail.com
License: GPL
Description: BasicEvents
        ===========
        
        python basic events send non-blocking
        
        Install
        -------
        
        .. code:: bash
        
            pip install basicevents
        
        Link pypi: https://pypi.python.org/pypi/basicevents
        
        Example
        -------
        
        .. code:: python
        
            # recommeded check all examples
            from basicevents import subscribe, send
        
            @subscribe("pepito")
            def example(*args, **kwargs):
                print "recv signal, values:", args, kwargs
        
            # add to queue signals (non-blocking)
            send("pepito", 1, 2, 3, example="added queue")
        
            # add to queue signals (non-blocking)
            send("pepito", 1, 2, 3, example="added queue", runtype='queue')
        
            # create new thread for this request (non-blocking)
            send("pepito", 1, 2, 3, example="new thread", runtype='thread')
        
            # This is blocking
            send("pepito", 1, 2, 3, example="blocking", runtype='blocking')
        
        Documentation
        -------------
        
        Functions
        ~~~~~~~~~
        
        Only two functions!
        
        @subscribe(name\_event) With this decorator you can subscribe to all
        events that are sent to name\_event.
        
        send(name\_event, \*args, \*\*kwargs) If caught in a parameter called
        instant in kwargs with True call is placed in a new thread.
        
        -  Note: Currently running as thread to allow sharing of memory, if you
           want an event to use more CPU (cores), you can run processes within
           the event.
        
        Attributes events
        ~~~~~~~~~~~~~~~~~
        
        -  events.subs
        
        return:
        
        .. code:: python
        
            {'juanito': [<function __main__.example2>],
             'pepito': [<function __main__.example>]}
        
        -  events.queue
        
        return queue
        
        queue is processed automatically and do not need to access this
        attribute, but if you want you can use
        https://docs.python.org/2/library/queue.html
        
        -  events.timeout
        
        return int
        
        It is the timeout of the get request queue. When it reaches the timeout
        check the MainThread is alive, if so wait to get back, if not, it sends
        a signal to the EventThread. You can modify it if you wish.
        
        .. code:: python
        
            from basicevents import events
            events.timeout = 1
        
        
        
        CHANGELOG
        =========
        
        1.0.2 (2015-08-14)
        ------------------
        
        -  increase performance function send (19%+)
        -  increase performance subscribe (2%+)
        
        1.0.1 (2015-08-13)
        ------------------
        
        -  fix pip install basicevents
        
        1.0.0 (2015-08-13)
        ------------------
        
        -  Now you can run blocker way events
        -  break compatibility function send (check documentation)
        
        0.1.5 (2015-08-12)
        ------------------
        
        -  update documentation
        
        0.1.4 (2015-08-12)
        ------------------
        
        -  update documentation
        -  remove instant key in kwargs
        
        0.1.3 (2015-08-12)
        ------------------
        
        -  Added changelog
        -  Auto convert md to rst in setup.py
        
        
Keywords: basicevents
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
