Skip to main content

Gevent based wrapper for pybonjour

Project description

Introduction
============

Salut is a Gevent based wrapper around the pybonjour library to facilitate
the use of bonjour in a cleaner way.

Salut is composed of two main classes, the Announcer and the Browser. Each have
a set of callbacks to respond to events without locking the main greenlet.


Example
=======

```python
class AnnouncerExample(object):
def run(self):
self._announcer = salut.Announcer(
'ServiceName',
'_regtype._tcp',
5000,
self._registered_callback)

while True:
gevent.sleep(1)

def stop(self):
self._announcer.stop()

def _registered_callback(self, domain, regtype, name):
print('announcing: %s%s%s' % (domain, regtype, name))
```

```python
class BrowseExample(object):
def run(self):
self._browser = salut.Browser(
'ServiceName',
'_regtype._tcp',
self._resolved_callback,
self._unresolved_callback)

while True:
gevent.sleep(1)

def stop(self):
self._browser.stop()

def _resolved_callback(self, ip, port):
print('resolved service to %s:%s' % (ip, port))

def _unresolved_callback(self):
print('lost service %s' % self._service_name)

```


License
=======

Salut is licensed under Apache License 2.0

http://www.apache.org/licenses/LICENSE-2.0

Project details


Release history Release notifications

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

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 the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
salut-0.1.3.tar.gz (7.1 kB) Copy SHA256 hash SHA256 Source None May 22, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page