Module: Qyu::Workers::Concerns::Split

Included in:
Split
Defined in:
lib/qyu/workers/concerns/split.rb

Overview

Qyu::Workers::Concerns::Split

Adds ability to split workers to specify slice size and splittable variable name

Qyu::SplitWorker.new do

slice_size 25
payload_key 'array'

end

Instance Method Summary collapse

Instance Method Details

#payload_key(var_name) ⇒ Object

Configures payload key with array to split

payload_key 25

33
34
35
# File 'lib/qyu/workers/concerns/split.rb', line 33

def payload_key(var_name)
  @payload_key = var_name
end

#sample(smpl) ⇒ Object

Run with sampling a single element out of the array

sample true

42
43
44
# File 'lib/qyu/workers/concerns/split.rb', line 42

def sample(smpl)
  @sample = smpl
end

#slice_size(slsz) ⇒ Object

Configures slice size

slice_size 25

24
25
26
# File 'lib/qyu/workers/concerns/split.rb', line 24

def slice_size(slsz)
  @slice_size = slsz
end