Wet::CommandBus

Command Pattern - decoupling what is done from who does it.

Usage:

require 'wet/command_bus'

command_bus = Wet::CommandBus.new
register    = command_bus.method(:register)

{ FooCommand => FooService.new(event_store: event_store).method(:foo),
  BarCommand => BarService.new,
}.map(&:register)


command_bus.(FooCommand.new)

Now think how that makes your system simpler and use it or forget and move on.

About

Arkency

Rails Event Store is funded and maintained by Arkency. Check out our other open-source projects.

You can also hire us or read our blog.