[IPython-dev] messaging protocol

Brian Granger ellisonbg at gmail.com
Fri Apr 8 01:42:25 EDT 2011


Jason,

I will reply more later, but the msg_id can be anything.  Couldn't you
just use a prefix like:

msg_counter-msg_uuid

01-123124214

Brian

On Thu, Apr 7, 2011 at 6:27 PM, Jason Grout <jason-sage at creativetrax.com> wrote:
> I've been pondering the messaging spec quite a bit over the last few
> weeks and meshing it in with a project in Sage (a single-cell server,
> like a one-off ipython or sage web notebook).  Our architecture is that
> we have a big database sitting on the server side that basically acts as
> a cache of the zeromq messages between the kernel and the web client. It
> is easy enough to store the messages in the database, but we have a
> problem that you guys don't have since you use zeromq end-to-end.  Once
> we put a list of messages into the database, we don't know what the
> right order for the messages is.  So here is a
> suggestion/request/proposal for the API:
>
> PROPOSAL: Can we add another field to the header of a, a msg_order (or
> msg_counter?) field, which (across messages with the same
> header['session']) is guaranteed to be an increasing integer signifying
> the order of messages?
>
> You might ask why we don't just use the msg_id field for this.  Well, it
> seems nice for us to make the msg_id be a mongodb id object, which is
> just a hash.  It seems elegant to let the client or server dictate what
> how the msg_id's are formed with no insistence on a particular format or
> structure for the msg_id, other than it be unique among messages in the
> same session.
>
> You must have had a related problem storing history, though.  How did
> you sort the messages in the history database?
>
> On the other hand, since the proposed msg_order *is* guaranteed to be
> unique across all messages in a session, maybe there's nothing lost in
> (just us?) insisting that the msg_id be an increasing integer sequence.
>
> Thanks,
>
> Jason
>
> --
> Jason Grout
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list