Module: Toro

Defined in:
lib/toro.rb,
lib/toro/cli.rb,
lib/toro/job.rb,
lib/toro/actor.rb,
lib/toro/client.rb,
lib/toro/worker.rb,
lib/toro/fetcher.rb,
lib/toro/logging.rb,
lib/toro/manager.rb,
lib/toro/monitor.rb,
lib/toro/railtie.rb,
lib/toro/version.rb,
lib/toro/database.rb,
lib/toro/listener.rb,
lib/toro/processor.rb,
lib/toro/actor_manager.rb,
lib/toro/monitor/engine.rb,
lib/toro/middleware/chain.rb,
lib/toro/monitor/custom_views.rb,
lib/toro/monitor/time_formatter.rb,
lib/toro/middleware/server/error.rb,
lib/toro/middleware/server/retry.rb,
lib/toro/middleware/server/properties.rb,
lib/toro/middleware/server/error_storage.rb,
app/datatables/toro/monitor/jobs_datatable.rb,
app/controllers/toro/monitor/base_controller.rb,
app/controllers/toro/monitor/jobs_controller.rb,
app/helpers/toro/monitor/toro_monitor_helper.rb,
lib/generators/toro/install/install_generator.rb,
app/controllers/toro/monitor/queues_controller.rb,
app/datatables/toro/monitor/abstract_datatable.rb,
app/datatables/toro/monitor/processes_datatable.rb,
app/controllers/toro/monitor/api/jobs_controller.rb,
app/controllers/toro/monitor/processes_controller.rb,
app/controllers/toro/monitor/api/queues_controller.rb,
app/controllers/toro/monitor/api/processes_controller.rb

Defined Under Namespace

Modules: Actor, ActorManager, Generators, Logging, Middleware, Monitor, Worker Classes: CLI, Client, Database, Fetcher, Job, Listener, Manager, Processor, Railtie, Shutdown

Constant Summary collapse

DEFAULTS =
{
  default_queue: 'default',
  graceful_shutdown_time: 1,
  hard_shutdown_time: 8,
  listen_interval: 5
}
VERSION =
'0.2.2'

Class Method Summary collapse

Class Method Details

.configure_server {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Toro)

    the object that the method was called on


32
33
34
# File 'lib/toro.rb', line 32

def configure_server
  yield self
end

.loggerObject


46
47
48
# File 'lib/toro.rb', line 46

def logger
  Toro::Logging.logger
end

.logger=(log) ⇒ Object


50
51
52
# File 'lib/toro.rb', line 50

def logger=(log)
  Toro::Logging.logger = log
end

.optionsObject


24
25
26
# File 'lib/toro.rb', line 24

def options
  @options ||= DEFAULTS.dup
end

.options=(options) ⇒ Object


28
29
30
# File 'lib/toro.rb', line 28

def options=(options)
  @options = options
end

.process_identityObject


42
43
44
# File 'lib/toro.rb', line 42

def process_identity
  @process_identity ||= "#{Socket.gethostname}:#{Process.pid}"
end

.server_middleware {|@server_chain| ... } ⇒ Object

Yields:

  • (@server_chain)

36
37
38
39
40
# File 'lib/toro.rb', line 36

def server_middleware
  @server_chain ||= Processor.default_middleware
  yield @server_chain if block_given?
  @server_chain
end