Class: Dionysus::Consumer::Registry::Registration::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/dionysus/consumer/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace, name, deserializer_klass, options = {}, &block) ⇒ Topic

Returns a new instance of Topic.



50
51
52
53
54
55
56
# File 'lib/dionysus/consumer/registry.rb', line 50

def initialize(namespace, name, deserializer_klass, options = {}, &block)
  @namespace = namespace
  @name = name
  @deserializer_klass = deserializer_klass
  @options = options
  @extensions_block = block
end

Instance Attribute Details

#consumerObject

Returns the value of attribute consumer.



48
49
50
# File 'lib/dionysus/consumer/registry.rb', line 48

def consumer
  @consumer
end

#deserializer_klassObject (readonly)

Returns the value of attribute deserializer_klass.



46
47
48
# File 'lib/dionysus/consumer/registry.rb', line 46

def deserializer_klass
  @deserializer_klass
end

#extensions_blockObject (readonly)

Returns the value of attribute extensions_block.



46
47
48
# File 'lib/dionysus/consumer/registry.rb', line 46

def extensions_block
  @extensions_block
end

#nameObject (readonly)

Returns the value of attribute name.



46
47
48
# File 'lib/dionysus/consumer/registry.rb', line 46

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



46
47
48
# File 'lib/dionysus/consumer/registry.rb', line 46

def namespace
  @namespace
end

#optionsObject (readonly)

Returns the value of attribute options.



46
47
48
# File 'lib/dionysus/consumer/registry.rb', line 46

def options
  @options
end

Instance Method Details

#concurrencyObject



74
75
76
# File 'lib/dionysus/consumer/registry.rb', line 74

def concurrency
  options.fetch(:concurrency, nil)
end

#consumer_base_classObject



70
71
72
# File 'lib/dionysus/consumer/registry.rb', line 70

def consumer_base_class
  options.fetch(:consumer_base_class, nil)
end

#params_batch_transformationObject



78
79
80
81
# File 'lib/dionysus/consumer/registry.rb', line 78

def params_batch_transformation
  options.fetch(:params_batch_transformation,
    Dionysus::Consumer::ParamsBatchTransformations::RemoveDuplicatesStrategy.new)
end

#sidekiq_backend?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/dionysus/consumer/registry.rb', line 66

def sidekiq_backend?
  options.fetch(:sidekiq, false)
end

#sidekiq_workerObject



62
63
64
# File 'lib/dionysus/consumer/registry.rb', line 62

def sidekiq_worker
  options.fetch(:worker, nil)
end

#to_sObject



58
59
60
# File 'lib/dionysus/consumer/registry.rb', line 58

def to_s
  Dionysus::TopicName.new(namespace, name).to_s
end