Class: Jp::JobPool::Processor

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

Direct Known Subclasses

Jp::JobPoolInstrumented::Processor

Instance Method Summary collapse

Methods inherited from FacebookService::Processor

#process_aliveSince, #process_getCounter, #process_getCounters, #process_getCpuProfile, #process_getName, #process_getOption, #process_getOptions, #process_getStatus, #process_getStatusDetails, #process_getVersion, #process_reinitialize, #process_setOption, #process_shutdown

Instance Method Details

#process_acquire(seqid, iprot, oprot) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 79

def process_acquire(seqid, iprot, oprot)
  args = read_args(iprot, Acquire_args)
  result = Acquire_result.new()
  begin
    result.success = @handler.acquire(args.pool_name)
  rescue Jp::NoSuchPool => nsp
    result.nsp = nsp
  rescue Jp::EmptyPool => ep
    result.ep = ep
  end
  write_result(result, oprot, 'acquire', seqid)
end

#process_add(seqid, iprot, oprot) ⇒ Object



68
69
70
71
72
73
74
75
76
77
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 68

def process_add(seqid, iprot, oprot)
  args = read_args(iprot, Add_args)
  result = Add_result.new()
  begin
    @handler.add(args.pool_name, args.message)
  rescue Jp::NoSuchPool => nsp
    result.nsp = nsp
  end
  write_result(result, oprot, 'add', seqid)
end

#process_purge(seqid, iprot, oprot) ⇒ Object



92
93
94
95
96
97
98
99
100
101
# File 'lib/rb/jp/gen-rb/job_pool.rb', line 92

def process_purge(seqid, iprot, oprot)
  args = read_args(iprot, Purge_args)
  result = Purge_result.new()
  begin
    @handler.purge(args.pool_name, args.id)
  rescue Jp::NoSuchPool => nsp
    result.nsp = nsp
  end
  write_result(result, oprot, 'purge', seqid)
end