Module: Taskinator
- Defined in:
- lib/taskinator.rb,
lib/taskinator/api.rb,
lib/taskinator/task.rb,
lib/taskinator/tasks.rb,
lib/taskinator/logger.rb,
lib/taskinator/queues.rb,
lib/taskinator/process.rb,
lib/taskinator/version.rb,
lib/taskinator/visitor.rb,
lib/taskinator/executor.rb,
lib/taskinator/definition.rb,
lib/taskinator/job_worker.rb,
lib/taskinator/complete_on.rb,
lib/taskinator/persistence.rb,
lib/taskinator/task_worker.rb,
lib/taskinator/queues/resque.rb,
lib/taskinator/process_worker.rb,
lib/taskinator/queues/sidekiq.rb,
lib/taskinator/redis_connection.rb,
lib/taskinator/definition/builder.rb,
lib/taskinator/queues/delayed_job.rb
Defined Under Namespace
Modules: Api, CompleteOn, Definition, Logging, Persistence, Queues, Visitor
Classes: Executor, JobWorker, Process, ProcessWorker, RedisConnection, Task, TaskWorker, Tasks
Constant Summary
collapse
- NAME =
"Taskinator"
- LICENSE =
'See LICENSE.txt for licensing details.'
- DEFAULTS =
{
}
- VERSION =
"0.0.12"
Class Attribute Summary collapse
-
.queue_adapter ⇒ Object
the queue adapter to use supported adapters include :delayed_job, :redis and :sidekiq NOTE: ensure that the respective gem is included.
-
.queue_config ⇒ Object
configuration, usually a hash, which will be passed to the configured queue adapter.
Class Method Summary
collapse
Class Attribute Details
.queue_adapter ⇒ Object
the queue adapter to use supported adapters include :delayed_job, :redis and :sidekiq NOTE: ensure that the respective gem is included
83
84
85
|
# File 'lib/taskinator.rb', line 83
def queue_adapter
@queue_adapter
end
|
.queue_config ⇒ Object
configuration, usually a hash, which will be passed to the configured queue adapter
92
93
94
|
# File 'lib/taskinator.rb', line 92
def queue_config
@queue_config
end
|
Class Method Details
Configuration for Taskinator client, use like:
Taskinator.configure_client do |config|
config.redis = { :namespace => 'myapp', :pool_size => 1, :url => 'redis://myhost:8877/0' }
config.queue_config = { :process_queue => 'processes', :task_queue => 'tasks' }
end
54
55
56
|
# File 'lib/taskinator.rb', line 54
def configure
yield self if block_given?
end
|
.options ⇒ Object
39
40
41
|
# File 'lib/taskinator.rb', line 39
def options
@options ||= DEFAULTS.dup
end
|
.options=(opts) ⇒ Object
42
43
44
|
# File 'lib/taskinator.rb', line 42
def options=(opts)
@options = opts
end
|
.queue ⇒ Object
99
100
101
102
103
|
# File 'lib/taskinator.rb', line 99
def queue
adapter = self.queue_adapter || :resque
config = queue_config || {}
@queue ||= Taskinator::Queues.create_adapter(adapter, config)
end
|
.redis(&block) ⇒ Object
58
59
60
61
|
# File 'lib/taskinator.rb', line 58
def redis(&block)
raise ArgumentError, "requires a block" unless block_given?
redis_pool.with(&block)
end
|