This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This module implements EventEmitter with gevent.

Installation

To install the latest release from pypi:

pip install gevent-eventemitter

Usage

EventEmitter can be used as mixin, or on it’s own. Here is an example as mixin:

from eventemitter import EventEmitter

class MyClass(EventEmitter):
    pass

instance = MyClass()

Registering a callback

def do_stuff():
    print "Hello world!"

instance.on('my event', do_stuff)

instance.emit('my event')

Or as decorator

@instance.on('my event')
def do_stuff():
    print "Hello world!"

With once the callback will be called, you guessed it, only once.

@instance.once('my event')
def do_stuff(var):
    print "Hello %s!" % var

instance.emit('my event', 'Earth')  # arguments can be passed along events
instance.emit('my event')  # do_stuff won't be called
It’s possible to block wait for an event.
If there are event arguments they will be returned as a tuple
my_args = instance.wait_event('my event')
my_args = instance.wait_event('my event', timeout=5)  # wait at most 5seconds

On timeout wait_event will return None, or raise gevent.Timeout if raises=True

my_args = instance.wait_event('my event', timeout=5)
if my_args is None:
    print "Timeout!"

try:
    my_args = instance.wait_event('my event', timeout=5, raises=True)
except gevent.Timeout:
    print "Timeout!"

To remove a callback, or all callbacks.

instance.remove_listener('my event', do_stuff)
instance.remove_all_listeners()                 # absolutely all listeners
instance.remove_all_listeners('my event')       # all listners for the event

Listening for None event will result in catching all events.

Release History

Release History

2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
gevent_eventemitter-2.0-py2.py3-none-any.whl (5.8 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 9, 2016
gevent-eventemitter-2.0.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Aug 9, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting