Where is the proper place to place eventmachine code in a rails app?
For example:
class Test < EventMachine::Connection
def post_init
send_data "test"
end
def receive_data(data)
end
end
EventMachine.run {
EventMachine.connect "someplace.com", 80, Test
}
Now say I required this for one of my controllers my app will just continue waiting while this runs.
How can I have this run in the background in a rails app?