Skip to content

Ruby examples are ready #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 18, 2011
Merged

Ruby examples are ready #2

merged 13 commits into from
May 18, 2011

Conversation

botanicus
Copy link

Hey guys, after some discussion we decided to push the Ruby examples before we release the official 0.8 ... I'll send an e-mail about this to RabbitMQ info.

majek added a commit that referenced this pull request May 18, 2011
@majek majek merged commit 09e3f89 into rabbitmq:master May 18, 2011
@annwitbrock
Copy link

We dont seem to be connected on chat. I use google chat
annwitbrock@googlemail.com
Are you able to connect?

I have a question for you.
Is there anything about using the ruby client that would appear OS dependent
to someone invoking it? Say I was writing a full tutorial...would you need
to install/compile/run/observe anything differently in any situation?

eg on Windows/Linux the compilation line for Java is differnt because one
has ; where the other has :
also different O/S for python used to need different install tools (they now
all use pip).

@botanicus
Copy link
Author

Unfortunately yes, it's the case. Well, not AMQP, but EventMachine is platform dependent, only the 1.0 beta works on Windows, the latest stable EM version doesn't. Otherwise it should be OK, although there would be useful to have some notes about installation, so far we decided not to release 0.8 for now and use prerelease versions which means you have to use the --pre argument for RubyGems, otherwise you get the last stable version ... which is quite easy to miss, so it'd be great to mention it, but obviously we can do so only in full tutorial, not in the code examples.

I believe the full tutorials would be really very useful and if we decide to go for it, I'll be more than happy to help!

// cc @michaelklishin

@annwitbrock
Copy link

It is apps created using the client library I'm interested in for the
tutorials. Ensuring we will provide all the information to install the
client lib (including gem etc) and to successfully create and run these
tutorial apps. I'm just trying to anticipate anything that might need to be
introduced as pre-requisites to succesful creation.
So if EventMachine is needed for the ruby client library to work, that would
be very relevant. I saw there was some community discussion about it being
flaky. It is important to resolve those kinds of issues (maybe removing
dependency on eventmachine - could you grab the useful part of the open
source?) to make our users experience as dependency free as possible.

On 3 June 2011 12:02, botanicus <
reply@reply.github.com>wrote:

Unfortunately yes, it's the case. Well, not AMQP, but EventMachine is
platform dependent, only the 1.0 beta works on Windows, the latest stable EM
version doesn't. Otherwise it should be OK, although there would be useful
to have some notes about installation, so far we decided not to release 0.8
for now and use prerelease versions which means you have to use the --pre
argument for RubyGems, otherwise you get the last stable version ... which
is quite easy to miss, so it'd be great to mention it, but obviously we can
do so only in full tutorial, not in the code examples.

I believe the full tutorials would be really very useful and if we decide
to go for it, I'll be more than happy to help!

// cc @michaelklishin

Reply to this email directly or view it on GitHub:
#2 (comment)

@michaelklishin
Copy link
Contributor

@annwitbrock,

Did see this guide? It lists all the pre-requisites. Some of those tools (RubyGems and Bundler) are used by virtually everyone and RubyGems ship with Ruby 1.9.2.

The chat has been dead to me for a few days. I will try to add you directly.

EventMachine is not flaky. It supports Windows including Windows 7 (although right now in a pre-release version) and all the alternatives that appear either don't support Windows at all and never will (based on libev) or very immature.
EventMachine also has Java implementation for JRuby. Alternatives do not.
The only quirk EM has has to do with fork(2) behavior with respect to threads, but that is the way forking works and if developers use forking tools (mod_python for Apache comes to mind), any alternative Python library would behave the same way.

@annwitbrock
Copy link

Hi Michael,

I meant that it appears that for some users, the process of obtaining the eventmachine dependency does not seem very smooth. I was wondering how much of it we actually need to depend on. If that were cleaned up for Windows (and other major platforms) it would reduce risk for users.

As I see it, communication and ubiquity/portability are things that go together. Connection is vital today.

I am not yet at all familiar with ruby, have barely touched it.
Thanks for your explanation. I hope you will keep me informed as we progress towards having ruby rabbits.

Ann

----- Original Message -----
From: "michaelklishin" reply@reply.github.com
To: annwitbrock@googlemail.com
Sent: Friday, 3 June, 2011 3:28:54 PM
Subject: Re: [rabbitmq-tutorials] Ruby examples are ready (#2)

@annwitbrock,

Did see this guide? It lists all the pre-requisites. Some of those tools (RubyGems and Bundler) are used by virtually everyone and RubyGems ship with Ruby 1.9.2.

The chat has been dead to me for a few days. I will try to add you directly.

EventMachine is not flaky. It supports Windows including Windows 7 (although right now in a pre-release version) and all the alternatives that appear either don't support Windows at all and never will (based on libev) or very immature.
EventMachine also has Java implementation for JRuby. Alternatives do not.
The only quirk EM has has to do with fork(2) behavior with respect to threads, but that is the way forking works and if developers use forking tools (mod_python for Apache comes to mind), any alternative Python library would behave the same way.

Reply to this email directly or view it on GitHub:
#2 (comment)

@michaelklishin
Copy link
Contributor

Ann,

EventMachine is one of the most portable event-driven I/O libraries I am aware of (among C, Ruby, Python and Java libraries I am aware of). It works on Windows, Mac OS X, Linux, Solaris and FreeBSD. It also works with JRuby thanks to the Java version (all in the same gem package). The only problem is that pre-compiled Windows 7 version is not released yet. amqp gem Getting Started guide mentions two solutions to this:

  • Install a pre-release version (by adding one command line switch, --pre)
  • Go with JRuby, which has no native code.

Both solutions sound reasonable: either one more line to run in the shell, or one archive to download and unpack. They are also documented in the very beginning of the Getting Started guide as well as GitHub README. amqp gem maintainers also know EventMachine maintainer fairly well and we know precisely what is going on with it and why.

I would be happy to answer more questions over IM or IRC.

@botanicus
Copy link
Author

Ann, EventMachine is a core dependency, it can't be removed. It wasn't my decision, it's how the gem works since ever. That's why I'm keen to have amq-client as a separate, agnostic library and implement the AMQP gem on top of it.

The problem is that dependencies on pre versions are tricky. That's actually another reason why we should wait with releasing 0.8 (till the EM 1.0 will be released).

@michaelklishin
Copy link
Contributor

And EM 1.0 will be released very soon (a few weeks). The only big item left to work on is rewriting pretty outdated (circa 2005, although the library itself didn't change much since that time) and reference-oriented documentation it has.

@botanicus
Copy link
Author

"I meant that it appears that for some users, the process of obtaining the eventmachine dependency does not seem very smooth."

We might be able to make it easier. Unfortunately I don't have Windows, but I suppose something like:

if RUBY_PLATFORM.match(/win32/) # mswin32, cygwin32
  s.add_dependency "eventmachine", ">= 1.0.beta"
else
  s.add_dependency "eventmachine"
end

In gemspec could work? Ann, you have Win, right? Would you please try to install http://static.101ideas.cz/amqp-0.8.0.rc13.pre.gem (download it and run gem install the_file.gem) and tell me whether it works (it gets the EM 1.0.beta[something], at this point it'll be EM 1.0.beta3). Cheers.

@michaelklishin
Copy link
Contributor

To be fair it is not any more difficult that getting started with some Python clients. And it will be just "gem install amqp --version '~> 0.8.0'" for everyone in a matter of month. With JRuby, it is like that today.

There is already a zero-dependency, blocking Ruby AMQP client for those who want that. I see the point of making life easier for newcomers but replacing a key component after year 3 simply to get rid of one line Windows 7 users have to add to their installation routine today is very hard to justify.

I know companies that use amqp gem precisely because it is EventMachine based and has good throughput that lets them process tens or hundreds GBs per day with it. I guarantee you they will fork the gem if it is to be ported to something else.

@annwitbrock
Copy link

I'll have another go at installing and get back to you. I did encounter the
eventmachine update issue the other day (about a month ago I think) when I
tried. I'm on XP.
There may also be an issue with paths or some other pre-requisite which I'm
not familiar with.

We'll see if it goes OK :-)

On 3 June 2011 17:56, botanicus <
reply@reply.github.com>wrote:

"I meant that it appears that for some users, the process of obtaining the
eventmachine dependency does not seem very smooth."

We might be able to make it easier. Unfortunately I don't have Windows, but
I suppose something like:

if RUBY_PLATFORM.match(/win32/) # mswin32, cygwin32
s.add_dependency "eventmachine", ">= 1.0.beta"
else
s.add_dependency "eventmachine"
end

In gemspec could work? Ann, you have Win, right? Would you please try to
install http://static.101ideas.cz/amqp-0.8.0.rc13.pre.gem (download it and
run gem install the_file.gem) and tell me whether it works (it gets the EM
1.0.beta[something], at this point it'll be EM 1.0.beta3). Cheers.

Reply to this email directly or view it on GitHub:
#2 (comment)

@annwitbrock
Copy link

On 3 June 2011 18:05, michaelklishin <
reply@reply.github.com>wrote:

To be fair it is not any more difficult that getting started with some
Python clients.

I have been happy to watch this get better with pip being more universally
effective for installation now :-)

And it will be just "gem install amqp --version '~> 0.8.0'" for everyone in
a matter of month. With JRuby, it is like that today.

That sounds very encouraging. Tidying up the seams is good for all
development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants