Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Stomp Ruby gem on GitHub
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Glenn Rempe  
View profile  
 More options May 11 2008, 6:37 pm
From: Glenn Rempe <glenn.re...@gmail.com>
Date: Sun, 11 May 2008 15:37:12 -0700 (PDT)
Local: Sun, May 11 2008 6:37 pm
Subject: Re: Stomp Ruby gem on GitHub
Hi Andrew,

Thanks for taking the time to provide a detailed response.  Much
appreciated.

I'll provide some comments below:

On May 10, 12:34 pm, "Andrew Kuklewicz" <kooks...@gmail.com> wrote:

> I'm a bit confused why it was necessary to fork the project, and I hope it
> does not becomes confusing for users.
> When I had a number of bug fixes and changes for the gem, I submitted
> patches and quickly found myself with commit rights.

> Is there a reason you didn't want to submit patches to the existing gem
> repo?
> I am watching the store and actively work on and use the gem, and would have
> been happy to help get your code committed, and I'm pretty such Brian would
> be happy to have more contributers as well.

I am totally happy to have the stomp gem use any of my patches and
pull them into the code.  My 'fork' is not so much to take the project
in a different direction, it is just the terminology used freely in
the Git/GiHub context where forks are encouraged, but used to feed
changes back to the master.  I have found github to be an excellent
tool for getting additional work done by others and feeding that back
to the master since the barrier to entry for submitting changes is so
very low (no commit privs needed, just fork and go, and then send pull
requests for changes.

> There are a number of changes to the stomp gem I have been working on lately
> that fix some errors in the existing retry logic.
> I am close to committing these to the gem trunk; I wonder how we can
> coordinate active development on the gem with your fork of the code?

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
github and we can merge our git repos easily.  Or I'll give you commit
access to my git repo directly.  Once all the changes are cool in this
working area we can bundle it all up in a patchset and commit it all
back to the SVN trunk for official release.

All this being said, if there is opposition to this approach, I am
fine with providing someone with patches agains the svn repo for any
changes that I have done and closing down the GitHub version if there
is confusion.  I think I made clear the intentions in the readme on
the site though.

> That said, if there is good stuff that comes out of your efforts, I would be
> happy to help you get your changes into the official stomp gem repository.

Cool.

> > Please accompany all code changes with matching Rspec specs, which
> > should be mocked/stubbed so they don't make calls directly to external
> > servers, or to collaborating classes.

> The current gem doesn't use or depend on rspec; I respect that this is how
> you like to work, but I would think it would be more appropriate to offer
> test unit classes, as that is what the gem uses now, and otherwise you end
> up with a mix of units and specs, and that's awkward.

The reason I was setting up the structure for having tests in Rspec is
because:

a) It is a much better testing framework IMHO. :-)
b) It has a built in mocking and stubbing framework so it will be
possible to build tests that:
    - Exercise only the class being tested (e.g. the Client and mock/
stub any calls to the Connection class).
   - Use mocks/stubs to mock the connection and responses from the
external stomp server.  This removes the dependency on having a
message queue running in order to run the tests (and allows you to
mock the expected response that the stomp spec says should be
returned, and not what different implementations of the spec actually
return.
  - Rspec provides mechanisms to keep the testing code more DRY.
Notice I was able to remove two of the test unit files completely
since they three files contained all of the same exact tests with only
the setup of the connection being different.  This makes maintenance
really hard.  Check out my start on Rspec where you'll see I was able
to duplicate the functionality and can run different setups against
the same suite of test cases.  You can see that in
http://github.com/grempe/stomp/tree/master/spec/client_spec.rb where I
specify it should 'it_should_behave_like "standard Client"'.

> > TODO : One thing I would personally like to see is an easy way to make
> > a synchronous request to the STOMP server which is non-blocking.

> The way the gem works now is that when you make a request, it blocks until
> that request has been sent to the broker.
> Is what you want to be able to do the send, but then immediately move on,
> regardless of if the request has to be retried, or can even be sent right
> away?  If so, it sounds like all you want is to use a different thread to do
> the send, such as putting the send in the block for a Thread.new.

To clarify what I would like to be able to do.  I want to be able 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.  As I
look at the comments in the code this is what poll seems to offer
(comments say : # Return a pending message if one is available,
otherwise return nil.).  However, if there are no messages on the
queue, poll blocks since its using the same receive method.  No?  My
expected behavior would wrap the process of opening a connection,
getting a message if avail, and then disconnecting.  While this may
not be as efficient as a thread which is listening and not always
opening and tearing down connections it is useful in some cases.

> Anyway, let me know if I have misunderstood, and I look forward to your
> contributions to stomp and messaging,

> - Andrew Kuklewicz

> Happy coding!

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
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. :-)

Cheers.

Glenn


 
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.