Module: Taskinator
  
  
  
  
  
  
  
  
  
  
  
  
    - Defined in:
- lib/taskinator/logger.rb,
 lib/taskinator.rb,
 lib/taskinator/api.rb,
 lib/taskinator/task.rb,
 lib/taskinator/tasks.rb,
 lib/taskinator/queues.rb,
 lib/taskinator/process.rb,
 lib/taskinator/version.rb,
 lib/taskinator/visitor.rb,
 lib/taskinator/executor.rb,
 lib/taskinator/workflow.rb,
 lib/taskinator/log_stats.rb,
 lib/taskinator/definition.rb,
 lib/taskinator/complete_on.rb,
 lib/taskinator/persistence.rb,
 lib/taskinator/task_worker.rb,
 lib/taskinator/xml_visitor.rb,
 lib/taskinator/queues/resque.rb,
 lib/taskinator/process_worker.rb,
 lib/taskinator/queues/sidekiq.rb,
 lib/taskinator/instrumentation.rb,
 lib/taskinator/redis_connection.rb,
 lib/taskinator/definition/builder.rb,
 lib/taskinator/queues/delayed_job.rb,
 lib/taskinator/create_process_worker.rb
 
Overview
  
Defined Under Namespace
  
    
      Modules: Api, CompleteOn, Definition, Instrumentation, LogStats, Logging, Persistence, Queues, Visitor, Workflow
    
  
    
      Classes: ConsoleInstrumenter, CreateProcessWorker, Executor, NoOpInstrumenter, Process, ProcessWorker, RedisConnection, Task, TaskWorker, Tasks
    
  
  
    
      Constant Summary
      collapse
    
    
      
        - NAME =
          
        
- "Taskinator" 
- LICENSE =
          
        
- 'See LICENSE.txt for licensing details.' 
- DEFAULTS =
          
        
- {
  }
- VERSION =
          
        
- "0.3.13" 
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
   
 
  
  
    | 
104
105
106 | # File 'lib/taskinator.rb', line 104
def queue_adapter
  @queue_adapter
end | 
 
    
      
      
      
  
  
    .queue_config  ⇒ Object 
  
  
  
  
    
configuration, usually a hash, which will be passed to the configured queue adapter
   
 
  
  
    | 
113
114
115 | # File 'lib/taskinator.rb', line 113
def queue_config
  @queue_config
end | 
 
    
   
  
    Class Method Details
    
      
  
  
    
Configuration for Taskinator client, use like:
Taskinator.configure do |config|
  config.redis = { :namespace => 'myapp', :pool_size => 1, :url => 'redis://myhost:8877/0' }
  config.queue_config = { :process_queue => 'processes', :task_queue => 'tasks' }
end
   
 
  
    | 
67
68
69 | # File 'lib/taskinator.rb', line 67
def configure
  yield self if block_given?
end | 
 
    
      
  
  
    .generate_uuid  ⇒ Object 
  
  
  
  
    | 
55
56
57 | # File 'lib/taskinator.rb', line 55
def generate_uuid
  SecureRandom.uuid
end | 
 
    
      
  
  
    .instrumenter  ⇒ Object 
  
  
  
  
    
set the instrumenter to use. can be ActiveSupport::Notifications
   
 
  
  
    | 
130
131
132 | # File 'lib/taskinator.rb', line 130
def instrumenter
  @instrumenter ||= NoOpInstrumenter.new
end | 
 
    
      
  
  
    .instrumenter=(value)  ⇒ Object 
  
  
  
  
    | 
133
134
135 | # File 'lib/taskinator.rb', line 133
def instrumenter=(value)
  @instrumenter = value
end | 
 
    
      
    
      
    
      
  
  
    .options  ⇒ Object 
  
  
  
  
    | 
48
49
50 | # File 'lib/taskinator.rb', line 48
def options
  @options ||= DEFAULTS.dup
end | 
 
    
      
  
  
    .options=(opts)  ⇒ Object 
  
  
  
  
    | 
51
52
53 | # File 'lib/taskinator.rb', line 51
def options=(opts)
  @options = opts
end | 
 
    
      
  
  
    .queue  ⇒ Object 
  
  
  
  
    | 
120
121
122
123
124
125
126 | # File 'lib/taskinator.rb', line 120
def queue
  @queue ||= begin
    adapter = self.queue_adapter || :resque
    config = queue_config || {}
    Taskinator::Queues.create_adapter(adapter, config)
  end
end | 
 
    
      
  
  
    .redis(&block)  ⇒ Object 
  
  
  
  
    | 
71
72
73
74 | # File 'lib/taskinator.rb', line 71
def redis(&block)
  raise ArgumentError, "requires a block" unless block_given?
  redis_pool.with(&block)
end | 
 
    
      
    
      
    
      
    
      
  
  
    .statsd_client=(client)  ⇒ Object