Documentation for pulsar 0.9.2. For development docs, go here.
Links
make_router()
methodcopy()
method for cloning a router class without
its routes.Html
initialisation and the Html.attr()
methodWsgiHandler
when passing response middlewareAsyncString.before_render()
method to add callbacks executed
just before an asynchronous string is renderedFlowControl
and Timeout
protocol mixins,
PulsarProtocol
now inherits from FlowControl
file
log handlerLinks
or Scripts
classesHttpClient
can be used in conjunction with
greenlet support to write implicit asynchronous HTTP
requestsget_request_loop
method. Full compatibility with
asyncioStore
constructortx()
decoratorImproperlyConfigured
exception, pulsar will log
and error without the full stack-trace
(exit_code
attribute is set to 2).
Useful when stopping execution because of a wrong input rather than an
internal exceptionRouter
when children are added via a decorated
methodsetup.py
script during installationslugify()
functionEventHandler
requires a valid event loop
during initialisationarbiter
and monitor
modules from async
, one Actor
class only, implementation differences handled by the different underlying
Concurrency
classes.Config
adds the default values of excluded settings to the
Config.params
dictionary. In this way the parameters cannot be set
on the command line but still be available.Router
Route.name
attributeWsgiResponse
does not send cookies back to the client by defaultmiddleware_in_executor()
WsgiRequest.redirect()
and Router.redirect()
methods
to simplify redirection.Links
test
applicationProtocolConsumer
has its own _loop
attribute rather than
obtaining indirectly from the underling Connection
.
This avoids several logging errors when a connection is droppedgreenio
module.Head.embedded_js
for adding javascript code directly in the
HtmlDocument
meta
tags in the HTML5 Head
classOAuth1
and OAuth2
hooks to the
http
module (alpha and untested)HttpParser
when Transfer-Encoding=chunked
HtmlDocument
Future
for compatibility with other frameworks.pulsar.apps.greenio
application for writing asynchronous code
using the greenlet library.PulsarDS
server into its own pulsar.apps.ds
moduleServer
and Date
from Hop headersMediaRouter
if the
path contain a default_file
(index.html
). This also means
show_indexes
in MediaRouter
initialisation is by default
False
.AsyncString
always returns a
Future
.get_event_loop()
,
new_event_loop()
,
are available from pulsar top level module as well as asyncio.
In other words from pulsar import get_event_loop
and
from asyncio import get_event_loop
are equivalent (provided pulsar is
imported first).Deferred
class with asyncio.Future
.EventLoop
class with
asyncio event loop.coroutine_return()
function.run_in_loop()
high level function. This utility
runs a callable in the event loop thread and returns a
Future
called back once the callable has
a result/exception.in_loop()
and task()
decorators for
member functions of async objects.async()
is now a function, not a decorator.Pool
class for managing a pool of asynchronous
connection with a server.add_async_binding()
function.Client
class and replaced by AbstractClient
which
in turns is a subclass of connections Producer
.force_sync
parameter when creating synchronous components.
Synchronous objects are now created by explicitly passing a new event
loop during initialisation.
Check the the synchronous components tutorial
for details.pulsar.apps.data
module for managing asynchronous data stores.Store
abstract class and registering it via the register_store()
function.on_open()
method is invoked soon
after upgrade headers are sent. No need to send a message from the client
to kick start the bidirectional communication.close()
frames with an optional status code, and for parsing close frames
with a body via the parse_close()
function (for websocket clients).WsgiResponse
Router
can have children even if it is a leaf nodepulsar.apps.pubsub
has been removed. Publish/subscribe
implementations are now available in the new pulsar.apps.data
module.Backend
class has been removed.Application
does not require to create picklable objects.TestCase
methods when used with the
run_on_arbiter()
decorator.Configurator.start()
method returns a Future
called back once the applications in the configurator are running.buildrelease.py
)setup.py
only import pulsar version and skip the restwait_for_body_middleware()
read the HTTP body only without
decoding itMANIFEST.in
so that they can be compiled from PyPisetup.py
for python 2.--coverage
option. By
passing in the command line --coveralls
when testing, coverage is
published to coveralls.io.Host
header if the
request URI is not an absolute URI. Follows the rfc2616 sec 5.2
guidelines.accept_content_type
method to WSGI Router.Actor.stream
attribute to write messages without using
the logger.is_async
function. Not used.async
decorator always return a
Deferred
, it never throws.Poller
base class for implementing different
types of event loop pollers. Implementation available for epoll
,
kqueue
and select
.Failure
implementation to handle one exc_info
only and better handling of unlogged failures.Queue
.async_while()
utility function.throw
method.Deferred
initialisation.Deferred.then()
method for adding a deferred to a
deferred’s callbacks without affecting the result.ThreadPool
for CPU bound operations.flush
method to the
task queue backend.
The metod can be used to remove all tasks and empty the task queue.selectors
module.full_route
and rule
attributes to wsgi Router.position
of children routes
via the route decorator.Queue
.exceptions
documentation.name
so that
they can easily be retrieved via the get_route
method.__repr__
method.ThreadPool
for for python 2.6.safe_async()
function for safely executing synchronous
and asynchronous callables.Config.get()
method never fails. It return the
default
value if the setting key is not available.setup.py
so that it does not log a python 2 module syntax error
when installing for python 3.pulsar.cache
key in
the environ
does not contain asynchronous data before invoking the
callable serving the request.EventLoop
.Deferred.cancel()
method to cancel asynchronous
callbacks.Deferred
accepts a timeout as initialisation parameter.
If a value greater than 0 is given, the deferred will add a timeout to the
event loop to cancel itself in timeout seconds.DeferredTask
stops after the first error by default.
This class replace the old DeferredGenerator and provides a cleaner
API with inline syntax. Check the
asynchronous components tutorial for
further information.async_sleep()
function.Actor
internal message passing uses the (unmasked)
websocket protocol in a bidirectional communication between the
Arbiter
and actors.pulsar.async.consts
module for low level pulsar constants.Actor._loop
attribute or via the pep-3156
function get_event_loop
.HttpClient
with websocket support.pulsar.apps.test
application.get_application()
returns a coroutine
so that it can be used in any process domain.set_async()
function which can be used to change
the asynchronous discovery functions maybe_async()
and maybe_failure()
. The function is used in the
implementation of twisted integration and could
be used in conjunction with other asynchronous libraries as well.FrozenDict
.pulsar.apps.rpc.JsonProxy
class.Actor.exit()
so that it shuts down Actor.mailbox
after closing the Actor.requestloop
.Deferred.result_or_self()
method to return the
result when the it is called and no callbacks are available.
It avoids several unnecessary calls on deeply nested Deferred
(which sometimes caused maximum recursion depth exceeded).MultiDeferred
.pulsar.apps
.TestPlugin
to handle multi-parameters.handle_wsgi_error()
accepts optional content_type
and encoding
parameters.Application
call Config.on_start()
before starting.Beta
.pulsar.utils.httpurl
module for HTTP tools and HTTP
synchronous and asynchronous clients.Deferred
to be more compatible with twisted. You
can add separate callbacks for handling errors.MultiDeferred
for handling a group of asynchronous
elements independent from each other.pulsar.Mailbox
does not derive from threading.Thread
so
that the eventloop can be restarted.ActorMetaClass
. Remote functions are specified using
a dictionary.Application
are built on top of the new
AsyncSocketServer
framework class.Alpha
.pulsar.apps.tasks
application.Job.send_to_queue()
method for allowing
Task
to create new tasks.Actor
is always available on the current thread
actor
attribute.pulsar.IOLoop.do_loop_tasks()
to avoid having monitors
crashing the arbiter.pulsar.system.system_info()
function which returns system information
regarding a running process. It requires psutil.spawn()
and send()
functions for
creating and communicating between Actor
.pulsar.net.HttpResponse.default_headers()
.pulsar.utils.http.Headers.pop()
method.pulsar.apps.tasks.Job.can_overlap
to be a callable.pulsar.apps.tasks.Job.doc_syntax
attribute which defaults to
"markdown"
.Application
can specify a version which overrides
pulsar.__version__
.pulsar.apps.tasks.Task.check_unready_tasks()
method.pulsar.apps.test.run_on_arbiter()
.Actor.ioloop
form the
current thread ioloop
attribute.Actor.mailbox
.unittest2
package is installed.pulsar.Mailbox
. Each client connections
has its own buffer.pulsar.apps.test
application.Mailbox
classes for handling message passing between actors.pulsar.apps.ws
, an asynchronous websocket application for pulsar.pulsar.net
module for internet primitive.