Class Ruote::Context
In: lib/ruote/context.rb
Parent: Object

A sort of internal registry, via a shared instance of this class, the worker and the engine can access subservices like reader, treechecker, wfid_generator and so on.

Methods

Constants

SERVICE_PREFIX = /^s\_/

External Aliases

dashboard -> engine
  Let‘s make sure Context always responds to storage, dashboard (engine) and worker.
dashboard -> engine
dashboard= -> engine=

Attributes

dashboard  [RW] 
storage  [R] 

Public Class methods

Public Instance methods

Used for things like

  if @context['ruby_eval_allowed']
    # ...
  end

Mostly used by engine#configure

A trick : in order to avoid

  @context = o.respond_to?(:context) ? o.context : o
  # or
  #@context = o.is_a?(Ruote::Context) ? o : o.context

simply letting a context say its context is itself.

Returns the engine_id (as set in the configuration under the key "engine_id"), or, by default, "engine".

Returns true if this context has a given service registered.

Configuration keys and service keys.

This method is called by the worker each time it sucessfully processed a msg. This method calls in turn the on_msg method for each of the services (that respond to that method).

Makes sure that observers that respond to wait_for are called last.

This is kind of evil. Notifies services responding to on_pre_msg with the msg before it gets processed.

Might be useful in some cases. Use with great care.

List of services in this context, sorted by their name in alphabetical order.

Takes care of shutting down every service registered in this context.

Let‘s make sure Context always responds to storage, dashboard (engine) and worker.

Protected Instance methods

[Validate]