andrewvc / learn-ruby-zeromq

Learn ZeroMQ using Ruby!
272 stars 29 forks source link

Modified ZMQ::Context#terminate() behavior? #4

Closed nickmabry closed 4 years ago

nickmabry commented 13 years ago

Hi guys,

I'm a total newbie to both ZMQ and ruby's threading in general, so take all of this with a grain of salt.

I started working through the first example and everything worked fine until the call to Context#terminate blocked indefinitely. From what I can gather from some quick googling, the underlying libzmq call now blocks until all sockets are closed, as opposed to closing all open sockets itself.

I made a few changes to the example to get it running, and thought I'd send back the results. Each socket now closes before its thread terminates and the call to Context#terminate is postponed until all threads have joined.

Thanks for the great examples!

andrewvc commented 13 years ago

Well, a lot of stuff has changed. I need to add a disclaimer to the repo that a lot of this stuff is, or may soon be out of date. I don't really have the time to maintain it sadly.

I'll check out your pull later today, and if it checks out I'll merge it in. Thanks! BTW, any other errors you find, feel free to send in.