mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
get it working
This commit is contained in:
parent
a62fbf9992
commit
f6a2fc1a8c
3 changed files with 13 additions and 5 deletions
|
@ -0,0 +1 @@
|
|||
require 'sidekiq/server'
|
|
@ -1,4 +1,5 @@
|
|||
require 'optparse'
|
||||
require 'sidekiq'
|
||||
|
||||
module Sidekiq
|
||||
class CLI
|
||||
|
@ -6,15 +7,13 @@ module Sidekiq
|
|||
parse_options
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def run
|
||||
write_pid
|
||||
|
||||
server = Sidekiq::Server.new(@options[:server], @options)
|
||||
begin
|
||||
log 'Starting processing, hit Ctrl-C to stop'
|
||||
server.run.join
|
||||
server.run
|
||||
rescue Interrupt
|
||||
log 'Shutting down...'
|
||||
server.stop
|
||||
|
@ -22,6 +21,8 @@ module Sidekiq
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def log(str)
|
||||
STDOUT.puts str
|
||||
end
|
||||
|
@ -35,7 +36,7 @@ module Sidekiq
|
|||
:quiet => false,
|
||||
:queues => [],
|
||||
:worker_threads => 25,
|
||||
:location => 'localhost:6379'
|
||||
:server => 'localhost:6379'
|
||||
}
|
||||
|
||||
@parser = OptionParser.new do |o|
|
||||
|
|
|
@ -4,6 +4,12 @@ module Sidekiq
|
|||
# Represents a connection to our MQ server.
|
||||
#
|
||||
class Server
|
||||
|
||||
def initialize(location, options={})
|
||||
p [location, options]
|
||||
end
|
||||
|
||||
def run
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue