Hi,
On Mon, Nov 23, 2009 at 19:52, Greg Thomas <
greg.d...@gmail.com> wrote:
> 2009/11/23 Simone Bordet <
simone...@gmail.com>
>>
>> Hi,
>>
>> On Sat, Nov 21, 2009 at 15:32, Greg <
greg.d...@gmail.com> wrote:
>> > Currently, in _connectResponse in cometd.js the client code ends the
>> > batch mode (line 798, in RC0) with a call to _endBatch(true); so that
>> > any outstanding messages are sent with the next long poll.
>>
>> Not exactly. They're sent immediately via the non-long poll connection.
>
>
> OK, I'm surprised as that; as we've just received the response from a
> long-poll, I'd
> assumed that the next thing that will go out is another long poll. It
> strikes me as
> wasteful to send out a long-poll followed immediately by a non-long poll.
Sure, this could be optimized, though it may complicate the
implementation a bit.
> JS is single threaded, yes, but it doesn't mean that you have to carry out
> a startBatch/endBatch pair in a single thread. For example, consider an
> online
> shopping basket. The client opens a batch. When a users adds an
> item to the basket, it's sent as publish'd to the server. When the client
> starts
> the checkout process, the batch is ended. OK, I probably wouldn't implement
> it that way myself, but I wouldn't consider it a horrible trick.
Well it's not what batches have been designed for.
They are not meant to span more than one context of execution.
I would be terribly deluded by my online shop if I choose 20 books,
put them in my basket (or thinking so), then my browser crashes and
whoops, my basket is gone.
> Given that the fix is relatively simple, it seems a shame not to support it.
I have not looked into your suggestion in detail, since IMHO your
premises are wrong.
I still have not yet a valid use case; your online store above seems a
bit too stretched to me (and you would not do that as well).
Plus, I am a little nervous making this change now that we're prepping
for 1.0 final.
> But if
> it's not going to be supported, then at the very least the limitation should
> be
> documented - it's not currently mentioned at
http://cometd.org/node/55
Will do that.
BTW, in your first email you said you had a problem and you thought it
was related to this.
You still have a problem, or this has been solved by your other thread
on cometd-users ?
Thanks,