You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "Darryl L. Pierce" <dp...@redhat.com> on 2015/02/02 15:12:22 UTC

Non-reactive engine examples?

Are there any example apps for Python that don't use the reactive APIs?

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


Re: Non-reactive engine examples?

Posted by Alan Conway <ac...@redhat.com>.
On Tue, 2015-02-03 at 16:26 -0500, Darryl L. Pierce wrote:
> On Mon, Feb 02, 2015 at 09:12:22AM -0500, Darryl L. Pierce wrote:
> > Are there any example apps for Python that don't use the reactive APIs?
> 
> If no examples, perhaps a primer of how the logical components of the
> enger interact to help guide providing an example?
> 

Not sure about Rafi's new C reactor but Gordon's util.py contains a
BlockingConnection which allows you to do simple blocking command-style
messaging built on top of the reactive framework. There's a
utils.SyncRequestResponse class I added that implements the
request-response pattern using BlockingConnection. You can use these
quite similarly to an API like qpid::messaging. 

IMO this is the way to go - the simpler patterns are built over the
reactor framework so that they are easy to use without worrying about
reactive programming *but* the power of the reactive framework is
lurking just below the surface when you need it.




Re: Non-reactive engine examples?

Posted by Rafael Schloming <rh...@alum.mit.edu>.
On Tue, Feb 3, 2015 at 4:26 PM, Darryl L. Pierce <dp...@redhat.com> wrote:

> On Mon, Feb 02, 2015 at 09:12:22AM -0500, Darryl L. Pierce wrote:
> > Are there any example apps for Python that don't use the reactive APIs?
>
> If no examples, perhaps a primer of how the logical components of the
> enger interact to help guide providing an example?
>

The quick primer is that Connections/Sessions/Links/Deliveries pretty much
directly model the endpoint state described in the AMQP specification. In
order to wire that endpoint state up to a remote peer, you create,
configure, and bind a Transport object into the Connection. The Transport
has an interface that lets you pump bytes into/out of it. You can use this
to pump bytes into/out of a socket.

When you pump bytes from the socket into the Transport, it may change the
state of the Connection and/or any of the objects it contains (Sessions,
Links, Deliveries, etc). It may in fact cause new Session, Link, or
Delivery endpoints to be created. The best way to find out what exactly has
happened here is to use the events API.

The events API allows you to register the Connection with a Collector. When
a Connection is registered with a Collector it will post events to that
Collector. Each event has a pointer back into the object model indicating
which object has changed state, and a type that indicates how/why it
changed state. You can look at event.h (or the doxygen) for a list of all
the core events.

--Rafael

Re: Non-reactive engine examples?

Posted by "Darryl L. Pierce" <dp...@redhat.com>.
On Mon, Feb 02, 2015 at 09:12:22AM -0500, Darryl L. Pierce wrote:
> Are there any example apps for Python that don't use the reactive APIs?

If no examples, perhaps a primer of how the logical components of the
enger interact to help guide providing an example?

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/