T
Tim Conner
I have a Ruby script that uses Event machine to listen on a port for
incoming data. When data is received, the script saves it to the
database.
How can I kill this script gracefully? I want to make sure that the
data is not being processed or saved the to DB when I kill it.
script looks something like:
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
module TestServer
def receive_data data
#Process and save data
end
end
EventMachine::run {
$a = EventMachine:pen_datagram_socket "", 1720,
TestServer
}
incoming data. When data is received, the script saves it to the
database.
How can I kill this script gracefully? I want to make sure that the
data is not being processed or saved the to DB when I kill it.
script looks something like:
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
module TestServer
def receive_data data
#Process and save data
end
end
EventMachine::run {
$a = EventMachine:pen_datagram_socket "", 1720,
TestServer
}