-
Notifications
You must be signed in to change notification settings - Fork 89
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
Multiple Blather Clients Not Working #129
Comments
You have to run all of them in the same EM reactor for now. I have no On 25 March 2014 16:20, eTM [email protected] wrote:
|
Hmm, solved it in my code by working around with EM#defer. This is a generic quick & dirty solution for most EM thread problems :-)
But after some quick digging, I think i know what the problem is :-) When changing self.connect you lose the rescue NoConnection, but you gain proper support for multiple clients.
As users are losing immediate connection problem handling (how many even check?, probably none :-)), something like a :connection_error handler similar to :ready handler would be nice. But one can survive without it - EM#error_handler should catch it too. Maybe an example in the README would suffice. |
In case somebody is looking for multiple client support. Here is a simple solution :
A few patches are needed in blather : |
When multiple blather clients are created in a program only the first one works. All other clients can't connect (never get ready).
2.times do
Thread.new do
EM.run do
client = Blather::Client.setup ...
client.register_handler(:ready) { print ... }
client.connect
end
end
end
The text was updated successfully, but these errors were encountered: