Class: DispatchPolicy::Gate

Inherits:
Object
  • Object
show all
Defined in:
lib/dispatch_policy/gate.rb

Instance Method Summary collapse

Instance Method Details

#consume(_decision, _admitted_count) ⇒ Object

Called after a successful admit to update gate-local state. Returns a hash patch to merge into partition.gate_state, or nil.



19
# File 'lib/dispatch_policy/gate.rb', line 19

def consume(_decision, _admitted_count); nil; end

#evaluate(_ctx, _partition, _admit_budget) ⇒ DispatchPolicy::Decision

Parameters:

  • ctx (DispatchPolicy::Context)
  • partition (Hash)

    the partitions row (string keys)

  • admit_budget (Integer)

    the budget remaining from earlier gates

Returns:

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/dispatch_policy/gate.rb', line 13

def evaluate(_ctx, _partition, _admit_budget)
  raise NotImplementedError
end

#nameObject

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/dispatch_policy/gate.rb', line 5

def name
  raise NotImplementedError
end