Class: Sourced::Consumer::ConsumerInfo

Inherits:
Types::Data
  • Object
show all
Defined in:
lib/sourced/consumer.rb

Constant Summary collapse

ToBlock =
Types::Any.transform(Proc) { |v| -> { v } }
StartFromBeginning =
Types::Value[:beginning] >> Types::Static[nil] >> ToBlock
StartFromNow =
Types::Value[:now] >> Types::Static[-> { Time.now - 5 }.freeze]
StartFromTime =
Types::Interface[:call].check('must return a Time') { |v| v.call.is_a?(Time) }
StartFrom =
(
  StartFromBeginning | StartFromNow | StartFromTime
).default { -> { nil } }

Instance Method Summary collapse

Instance Method Details

#async!Object



23
24
25
# File 'lib/sourced/consumer.rb', line 23

def async!
  self.async = true
end

#sync!Object



19
20
21
# File 'lib/sourced/consumer.rb', line 19

def sync!
  self.async = false
end