Class: Jp::JobPool::Client

Inherits:
FacebookService::Client show all
Includes:
Thrift::Client
Defined in:
lib/rb/jp/gen-rb/job_pool.rb

Direct Known Subclasses

Jp::JobPoolInstrumented::Client

Instance Method Summary collapse

Methods inherited from FacebookService::Client

#aliveSince, #getCounter, #getCounters, #getCpuProfile, #getName, #getOption, #getOptions, #getStatus, #getStatusDetails, #getVersion, #recv_aliveSince, #recv_getCounter, #recv_getCounters, #recv_getCpuProfile, #recv_getName, #recv_getOption, #recv_getOptions, #recv_getStatus, #recv_getStatusDetails, #recv_getVersion, #recv_setOption, #reinitialize, #send_aliveSince, #send_getCounter, #send_getCounters, #send_getCpuProfile, #send_getName, #send_getOption, #send_getOptions, #send_getStatus, #send_getStatusDetails, #send_getVersion, #send_reinitialize, #send_setOption, #send_shutdown, #setOption, #shutdown

Instance Method Details

#acquire(pool_name) ⇒ Object



31
32
33
34
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 31

def acquire(pool_name)
  send_acquire(pool_name)
  return recv_acquire()
end

#add(pool_name, message) ⇒ Object



16
17
18
19
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 16

def add(pool_name, message)
  send_add(pool_name, message)
  recv_add()
end

#purge(pool_name, id) ⇒ Object



48
49
50
51
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 48

def purge(pool_name, id)
  send_purge(pool_name, id)
  recv_purge()
end

#recv_acquireObject

Raises:

  • (::Thrift::ApplicationException)


40
41
42
43
44
45
46
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 40

def recv_acquire()
  result = receive_message(Acquire_result)
  return result.success unless result.success.nil?
  raise result.nsp unless result.nsp.nil?
  raise result.ep unless result.ep.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'acquire failed: unknown result')
end

#recv_addObject



25
26
27
28
29
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 25

def recv_add()
  result = receive_message(Add_result)
  raise result.nsp unless result.nsp.nil?
  return
end

#recv_purgeObject



57
58
59
60
61
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 57

def recv_purge()
  result = receive_message(Purge_result)
  raise result.nsp unless result.nsp.nil?
  return
end

#send_acquire(pool_name) ⇒ Object



36
37
38
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 36

def send_acquire(pool_name)
  send_message('acquire', Acquire_args, :pool_name => pool_name)
end

#send_add(pool_name, message) ⇒ Object



21
22
23
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 21

def send_add(pool_name, message)
  send_message('add', Add_args, :pool_name => pool_name, :message => message)
end

#send_purge(pool_name, id) ⇒ Object



53
54
55
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 53

def send_purge(pool_name, id)
  send_message('purge', Purge_args, :pool_name => pool_name, :id => id)
end