In the developo branch of my fork (https://github.com/jasom) I've
created a new type of plugin system for handling replies from handlers.
Included is a simple "sendfile" type implementation
(tools/filters/sendfile.c).  You can add it to a server similarly to how
you do a Filter:

sendfile=Xrequest(name="tools/filters/sendfile.so",settings={})

main = Server(
...
    xrequests=[sendfile],
...
    )

Before pulling this into the main repository I thought I'd ask for any
comments about it.  If you want to test the sendfile plugin you can do
that as well.  There is an example of how to do that in
examples/http_0mq/sendfile.py; As you can see the extended request
format is just like a normal handler deliver, except the first ID is "X"
instead of a number.  The payload must be a tnetstring, and can be
anything serializable in tnetstrings, whic would allow e.g. sending
dictionaries for doing fancy stuff in plugins.

-Jason

Reply via email to