23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/ec2-api-proxy/server.rb', line 23
def run
@@control_options = {
:memcached => @@options[:memcached],
:expires => @@options[:expires],
:compress => @@options[:compress],
:use_https => @@options[:use_https],
:debug => @@options[:debug],
}
FileUtils.rm_f(@@options[:socket])
DRb.start_service("drbunix:#{@@options[:socket]}", @@control_options)
File.chmod(0700, @@options[:socket])
at_exit { FileUtils.rm_f(@@options[:socket]) }
EM.epoll
EM.threadpool_size = @@options[:threads] if @@options[:threads]
EM.run {
memcached = Dalli::Client.new(@@options[:memcached], :compress => @@options[:compress])
EM.start_server(@@options[:addr], @@options[:port], EC2APIProxy::Proxy, @@control_options, memcached)
}
end
|