librelist archives

« back to archive

Proposed Minor Protocol Changes

Proposed Minor Protocol Changes

From:
Zed A. Shaw
Date:
2010-07-19 @ 18:47
Writing the mp3streamer demo I ran into three things that need to change
for the handler's responses.  Let me know how these grab you:

1.  Right now you can't send a message of "1 2 3 4".  The numbers will
be interpreted by Mongrel2 as more listener connection IDs.  It wasn't a
problem with just plain HTTP responses or JSON, but now that you can
just stream anything you want it's a problem.  The proposal is that
you'll put the list of connection IDs inside a netstring.

2.  You'll have to put the sender_id in front, so that things like
subscriptions and routing work.

3.  You'll need a way to close a connection, like at the end of
streaming, so if you send an empty (0 byte) message then Mongrel2 will
close the listener.

That's it, which means your response will now be something like:


42de7d6b-34e6-44cd-a33b-02f4c4eecbbe 2:35, The data...

Notice there's still spaces between each piece for readability.  Also,
the sender_id can't go in a netstring because that will screw up the 0MQ
subscriptions and routing.

So, everyone who's made handlers let me know if you're cool with this.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Proposed Minor Protocol Changes

From:
Andreas Krennmair
Date:
2010-07-20 @ 07:02
* Zed A. Shaw <zedshaw@zedshaw.com> [2010-07-19 20:50]:
>So, everyone who's made handlers let me know if you're cool with this.

I'm fine with this.

Regards,
Andreas

Re: [mongrel2] Proposed Minor Protocol Changes

From:
Colin Curtin
Date:
2010-07-19 @ 18:51
I'm cool with this. Let us know when it drops and I'll update m2r.

On Mon, Jul 19, 2010 at 11:47 AM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> Writing the mp3streamer demo I ran into three things that need to change
> for the handler's responses.  Let me know how these grab you:
>
> 1.  Right now you can't send a message of "1 2 3 4".  The numbers will
> be interpreted by Mongrel2 as more listener connection IDs.  It wasn't a
> problem with just plain HTTP responses or JSON, but now that you can
> just stream anything you want it's a problem.  The proposal is that
> you'll put the list of connection IDs inside a netstring.
>
> 2.  You'll have to put the sender_id in front, so that things like
> subscriptions and routing work.
>
> 3.  You'll need a way to close a connection, like at the end of
> streaming, so if you send an empty (0 byte) message then Mongrel2 will
> close the listener.
>
> That's it, which means your response will now be something like:
>
>
> 42de7d6b-34e6-44cd-a33b-02f4c4eecbbe 2:35, The data...
>
> Notice there's still spaces between each piece for readability.  Also,
> the sender_id can't go in a netstring because that will screw up the 0MQ
> subscriptions and routing.
>
> So, everyone who's made handlers let me know if you're cool with this.
>
> --
> Zed A. Shaw
> http://zedshaw.com/
>



-- 
=begin
Colin Curtin
Engineer, Cramer Development
http://cramerdev.com
email:  colin@cramerdev.com
skype: colin.t.curtin
phone: +1.805.694.UNIX (8649)
=end