Module: Nanite

Defined in:
lib/nanite.rb,
lib/nanite/job.rb,
lib/nanite/log.rb,
lib/nanite/amqp.rb,
lib/nanite/actor.rb,
lib/nanite/admin.rb,
lib/nanite/agent.rb,
lib/nanite/config.rb,
lib/nanite/mapper.rb,
lib/nanite/reaper.rb,
lib/nanite/cluster.rb,
lib/nanite/console.rb,
lib/nanite/packets.rb,
lib/nanite/identity.rb,
lib/nanite/daemonize.rb,
lib/nanite/streaming.rb,
lib/nanite/dispatcher.rb,
lib/nanite/serializer.rb,
lib/nanite/actor_registry.rb

Defined Under Namespace

Modules: AMQPHelper, Actor, CommonConfig, Console, ConsoleHelper, DaemonizeHelper, FileStreaming, Identity Classes: ActorRegistry, Admin, Advertise, Agent, Cluster, Dispatcher, FileChunk, FileEnd, FileStart, Job, JobWarden, Log, Mapper, MapperNotRunning, Packet, Ping, Push, Reaper, Register, Request, Result, Serializer

Constant Summary collapse

VERSION =
'0.3.0'
COMMON_DEFAULT_OPTIONS =
{:pass => 'testing', :vhost => '/nanite', :secure => false, :host => '0.0.0.0',
:log_level => :info, :format => :marshal, :daemonize => false, :console => false, :root => Dir.pwd}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.agentObject (readonly)

Returns the value of attribute agent.



34
35
36
# File 'lib/nanite.rb', line 34

def agent
  @agent
end

.mapperObject (readonly)

Returns the value of attribute mapper.



34
35
36
# File 'lib/nanite.rb', line 34

def mapper
  @mapper
end

Class Method Details

.ensure_mapperObject

Raises:



54
55
56
# File 'lib/nanite.rb', line 54

def ensure_mapper
  raise MapperNotRunning.new('A mapper needs to be started via Nanite.start_mapper') unless @mapper
end

.push(*args) ⇒ Object



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

def push(*args)
  ensure_mapper
  @mapper.push(*args)
end

.request(*args, &blk) ⇒ Object



44
45
46
47
# File 'lib/nanite.rb', line 44

def request(*args, &blk)
  ensure_mapper
  @mapper.request(*args, &blk)
end

.start_agent(options = {}) ⇒ Object



36
37
38
# File 'lib/nanite.rb', line 36

def start_agent(options = {})
  @agent = Nanite::Agent.start(options)
end

.start_mapper(options = {}) ⇒ Object



40
41
42
# File 'lib/nanite.rb', line 40

def start_mapper(options = {})
  @mapper = Nanite::Mapper.start(options)
end