views:

113

answers:

1

I understand that it isn't possible/sensible to use threads in RubyCocoa. However it is possible to use asynchronous Cocoa methods to avoid blocking user interface events.

I've successfully used a method on NSURLConnection to send an HTTP request and receive the response without blocking the user interface. But I'm wondering what other asynchronous Cocoa methods like this are available?

Also is it possible/sensible within a RubyCocoa application to use Ruby to spawn separate processes (as opposed to threads)? I suppose one issue would be how to wait for the process to complete, but perhaps this could be done by polling via NSTimer events?

A: 

Check this client, it's written in ruby and works pretty well. httpclient

Nava Carmon
I've moved away from using a Ruby HTTP client specifically to avoid blocking user interface events. My question is not about how to make HTTP requests in RubyCocoa, but how to perform long-running tasks without blocking the user interface.
floehopper