Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
February 10, 2017 09:45
December 27, 2017 18:47
December 28, 2017 18:00
November 27, 2017 15:53
December 29, 2017 11:57
November 23, 2017 19:48
November 21, 2017 15:47
December 28, 2017 18:00
November 16, 2017 21:58
December 29, 2017 12:21
December 28, 2017 10:45
December 28, 2017 10:17
November 23, 2017 11:20
November 21, 2017 17:27
February 10, 2017 11:21
December 28, 2017 18:00


Badges:license pyversions status pypiversion contributors
CI:circleci coverage appveyor travis docs
Chat room
Mailing list:google user group
Stack overflow:questions tagged python-pulsar
Design by:Quantmind and Luca Sbardella
Platforms:Linux, OSX, Windows. Python 3.5 and above
Keywords:python, asyncio, multiprocessing, client/server, asynchronous, concurrency, actor, thread, process, socket, wsgi, websocket, redis, json-rpc

An example of a web server written with pulsar which responds with "Hello World!" for every request:

from pulsar.apps import wsgi

def hello(environ, start_response):
    data = b'Hello World!\n'
    response_headers = [
        ('Content-Length', str(len(data)))
    start_response('200 OK', response_headers)
    return [data]

if __name__ == '__main__':

Pulsar's goal is to provide an easy way to build scalable network programs. In the Hello world! web server example above, many client connections can be handled concurrently. Pulsar tells the operating system (through epoll or select) that it should be notified when a new connection is made, and then it goes to sleep.

Pulsar uses the asyncio module from the standard python library and it can be configured to run in multi-processing mode.

Another example of pulsar framework is the asynchronous HttpClient:

from pulsar.apps import http

async with http.HttpClient() as session:
    response1 = await session.get('')
    response2 = await session.get('')

The http client maintains connections alive (by default 15 seconds) and therefore any requests that you make within a session will automatically reuse the appropriate connection. All connections are released once the session exits the asynchronous with block.


Pulsar has one hard dependency:

install via pip:

pip install pulsar

or download the tarball from pypi.

To speedup pulsar by a factor of 2 or more these soft dependencies are recommended


Pulsar design allows for a host of different asynchronous applications to be implemented in an elegant and efficient way. Out of the box it is shipped with the the following:


Check out the examples directory for various working applications. It includes:


Pulsar internals are based on actors primitive. Actors are the atoms of pulsar's concurrent computation, they do not share state between them, communication is achieved via asynchronous inter-process message passing, implemented using the standard python socket library.

Two special classes of actors are the Arbiter, used as a singleton, and the Monitor, a manager of several actors performing similar functions. The Arbiter runs the main eventloop and it controls the life of all actors. Monitors manage group of actors performing similar functions, You can think of them as a pool of actors.

Pulsar Actors

More information about design and philosophy in the documentation.


Pulsar checks if some additional libraries are available at runtime, and uses them to add additional functionalities or improve performance:

  • greenlet: required by the pulsar.apps.greenio module and useful for developing implicit asynchronous applications
  • uvloop: if available it is possible to use it as the default event loop for actors by passing --io uv in the command line (or event_loop="uv" in the config file)
  • httptools: if available, the default Http Parser for both client and server is replaced by the C implementation in this package
  • setproctitle: if installed, pulsar can use it to change the processes names of the running application
  • psutil: if installed, a system key is available in the dictionary returned by Actor info method
  • python-certifi: The HttpClient will attempt to use certificates from certifi if it is present on the system
  • ujson: if installed it is used instead of the native json module
  • unidecode: to enhance the slugify function

Running Tests

Pulsar test suite uses the pulsar test application. To run tests:

python test

For options and help type:

python test --help

flake8 check (requires flake8 package):



Development of pulsar happens at Github. We very much welcome your contribution of course. To do so, simply follow these guidelines:

  • Fork pulsar on github
  • Create a topic branch git checkout -b my_branch
  • Push to your branch git push origin my_branch
  • Create an issue at with pull request for the dev branch.
  • Alternatively, if you need to report a bug or an unexpected behaviour, make sure to include a mcve in your issue.

A good pull request should:

  • Cover one bug fix or new feature only
  • Include tests to cover the new code (inside the tests directory)
  • Preferably have one commit only (you can use rebase to combine several commits into one)
  • Make sure flake8 tests pass


This software is licensed under the BSD 3-clause License. See the LICENSE file in the top distribution directory for the full license text.