From: "Andrew Kuklewicz" <kooks...@gmail.com>
Date: Mon, 12 May 2008 13:06:52 -0400
Local: Mon, May 12 2008 1:06 pm
Subject: Re: Stomp Ruby gem on GitHub
I was really happy to see Brian's support behind this - I was feeling a bit A few comments below: On Sun, May 11, 2008 at 6:37 PM, Glenn Rempe <glenn.re...@gmail.com> wrote: I have no personal opposition to what you have done. I reacted a bit > My git repo is actually able to be actively connected to both the SVN > master which I would pull your changes from, and then merge them into > my branch which is what I would push to GitHub. So if you or others > commit changes I can get those onto Git and keep everything in synch. > Or even better :-) You can fork my git repo, and push the work onto > All this being said, if there is opposition to this approach, I am conservatively only as Brian had not weighed in yet, and I wanted to make sure he was cool with this. I'll try to get my changes in using your git rather than svn - I am not > The reason I was setting up the structure for having tests in Rspec is I like consistency - if all the tests are moving to specs, I am cool with > because: > ... it. I agree that mocking is essential in testing code like this. > To clarify what I would like to be able to do. I want to be able to The "_receive" private method is passed in a connection, and tries once to > make a call to @connection.somemethod and have it return the next > message on the specified queue. If there is a message, give it to me > and close the connection. If there is no message return nil. get a response frame, then returns nil if there is none. The "receive" public method tries to establish a connection by calling "socket", then uses "_receive" to try once to get a message. Where "receive" can block is when the connection needs to be (re)established, and the connection attribute reliable == true. If the connection is good, it will therefore try to call "_receive" once Well, that is a slight gloss - "_receive" does block, but only in order to One of the changes I have been working on is cleaning up the way recieve and I am generally not a huge fan of the existing retry logic, which we are As I > look at the comments in the code this is what poll seems to offer queue, poll blocks since its using the same receive method. No? > (comments say : # Return a pending message if one is available, > otherwise return nil.). However, if there are no messages on the stomp gem; it is an unneeded wrapper on receive as far as I am concerned. It really ought to be deprecated, removed, or repurposed to do something useful. The only thing it does is return nil if there is not a connection already, whereas receive will open a connection if there is none. Never had a reason to use this. So yeah, that comment is not exactly true, as described above: > My Set reliable=false, and that is what calling receive will do, except it does > expected behavior would wrap the process of opening a connection, > getting a message if avail, and then disconnecting. not automatically disconnect. We can add another method perhaps that also does he disconnect, but there should be some method such as receive that does not do this, as disconnecting will get rid of all your existing subscriptions, and you really don't always want to do that - activemessaging relies on the fact that once you have connected and subscribed, it can simply use receive to get messages off without having the overhead of reconnecting and resubscribing. > While this may In some cases, I agree, and in those cases, we can have a different method, > not be as efficient as a thread which is listening and not always > opening and tearing down connections it is useful in some cases. or finer grained options for retry logic. ActiveMessaging is built using the assumption of a single connection with subscriptions to receive messages as they come in, and not closing and resubscribing all the time. Thanks again for the detailed response. Actually much of what you > said should be included in the rdoc comments in the code to make it Of course not - I've spent alot of time in this code, for better or worse. I > clearer for newcomers how some of the code is expected to work. > Perhaps I'll drop some of your comments in as a starting point if you > don't mind. :-) hope my long-windedness can be slightly helpful to the new guard. -Andrew You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||