Class: Gearman::Packet::Repository
- Inherits:
-
Object
- Object
- Gearman::Packet::Repository
- Defined in:
- lib/gearman/packet/repository.rb
Instance Method Summary collapse
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #load(number) ⇒ Object
- #store(number, type, takes = []) ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gearman/packet/repository.rb', line 7 def initialize @by_number = {} store(1, 'CAN_DO', [:function_name]) store(2, 'CANT_DO', [:function_name]) store(4, 'PRE_SLEEP') store(6, 'NOOP') store(8, 'JOB_CREATED', [:handle]) store(9, 'GRAB_JOB') store(10, 'NO_JOB') store(11, 'JOB_ASSIGN', [:handle, :function_name, :data]) store(13, 'WORK_COMPLETE', [:handle, :data]) store(18, 'SUBMIT_JOB_BG', [:function_name, :unique_id, :data]) store(19, 'ERROR', [:error_code, :text]) store(25, 'WORK_EXCEPTION', [:handle, :data]) end |
Instance Method Details
#load(number) ⇒ Object
29 30 31 |
# File 'lib/gearman/packet/repository.rb', line 29 def load(number) @by_number[number] end |