Class: Pubsub::Redis::DomainEventPublisher
- Inherits:
-
DomainEventPublisher
- Object
- DomainEventPublisher
- Pubsub::Redis::DomainEventPublisher
- Defined in:
- lib/pubsub/redis.rb
Instance Method Summary collapse
-
#initialize(redis_client, serializer, channel) ⇒ DomainEventPublisher
constructor
A new instance of DomainEventPublisher.
- #publish(domain_event) ⇒ Object
Constructor Details
#initialize(redis_client, serializer, channel) ⇒ DomainEventPublisher
Returns a new instance of DomainEventPublisher.
8 9 10 11 12 |
# File 'lib/pubsub/redis.rb', line 8 def initialize(redis_client, serializer, channel) @redis_client = redis_client @serializer = serializer @channel = channel end |
Instance Method Details
#publish(domain_event) ⇒ Object
14 15 16 17 |
# File 'lib/pubsub/redis.rb', line 14 def publish(domain_event) @redis_client.publish(@channel, @serializer.serialize(domain_event.to_h)) end |