Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A Python implementation of socket.io-emitter

Project Description
socket.io-python-emitter
========================

A Python implementation of socket.io-emitter

[socket.io](http://socket.io/) provides a hook point to easily allow you to emit events to browsers from anywhere so `socket.io-python-emitter` communicates with [socket.io](http://socket.io/) servers through redis.

## How to use

**Install via pip**

```py
pip install socket.io-emitter
```

```py
io=Emitter({'host': 'localhost', 'port':6379})
io.Emit('broadcast event','Hello from socket.io-python-emitter')

```

## API

### Emitter(opts)

The following options are allowed:

- `client`: is a [redis-py](https://github.com/andymccurdy/redis-py) compatible client
This argument is optional.
- `key`: the name of the key to pub/sub events on as prefix (`socket.io`)
- `host`: host to connect to redis on (`localhost`)
- `port`: port to connect to redis on (`6379`)

If you don't want to supply a redis client object, and want
`socket.io-python-emitter` to initialize one for you, make sure to supply the
`host` and `port` options.

Specifies a specific `room` that you want to emit to.

### Emitter#In(room):Emitter
```py

io=Emitter({'host': 'localhost', 'port':6379})
io.In("room-name").Emit("news","Hello from python emitter");
```
### Emitter#To(room):Emitter
```py

io=Emitter({'host': 'localhost', 'port':6379})

io.To("room-name").Emit("news","Hello from python emitter");
```

### Emitter#Of(namespace):Emitter
Specifies a specific namespace that you want to emit to.
```py

io=Emitter({'host': 'localhost', 'port':6379})

io.Of("/nsp").In("room-name").Emit("news","Hello from python emitter");
```


## License

MIT

###Open Source Projects in Use
* [redis-py](https://github.com/andymccurdy/redis-py) by Andy McCurdy @andymccurdy
* [msgpack-python](https://github.com/msgpack/msgpack-python) by MessagePack
Release History

Release History

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
socket.io-emitter-0.1.3.tar.gz (2.3 kB) Copy SHA256 Checksum SHA256 Source Sep 6, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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