Skip to content

Commit

Permalink
explicit requires
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandotsmith committed Jul 9, 2013
1 parent fcb4d84 commit 79c3e31
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
13 changes: 4 additions & 9 deletions lib/queue_classic.rb
@@ -1,12 +1,3 @@
require "pg"
require "uri"
require "json"

require "queue_classic/conn"
require "queue_classic/queue"
require "queue_classic/worker"
require "queue_classic/setup"

module QC
Root = File.expand_path("..", File.dirname(__FILE__))
SqlFunctions = File.join(QC::Root, "/sql/ddl.sql")
Expand Down Expand Up @@ -93,3 +84,7 @@ def self.log(data)
return result
end
end

require "queue_classic/queue"
require "queue_classic/worker"
require "queue_classic/setup"
2 changes: 2 additions & 0 deletions lib/queue_classic/conn.rb
@@ -1,4 +1,6 @@
require 'thread'
require 'uri'
require 'pg'

module QC
module Conn
Expand Down
4 changes: 4 additions & 0 deletions lib/queue_classic/queue.rb
@@ -1,3 +1,7 @@
require 'queue_classic'
require 'queue_classic/conn'
require 'json'

module QC
class Queue

Expand Down
6 changes: 5 additions & 1 deletion lib/queue_classic/worker.rb
@@ -1,3 +1,7 @@
require 'queue_classic'
require 'queue_classic/queue'
require 'queue_classic/conn'

module QC
class Worker

Expand All @@ -6,7 +10,7 @@ class Worker
# the defaults are pulled from the environment variables.
def initialize(args={})
@fork_worker = args[:fork_worker] || QC::FORK_WORKER
@queue = Queue.new((args[:q_name] || QC::QUEUE), args[:top_bound])
@queue = QC::Queue.new((args[:q_name] || QC::QUEUE), args[:top_bound])
log(args.merge(:at => "worker_initialized"))
@running = true
end
Expand Down

0 comments on commit 79c3e31

Please sign in to comment.