sequent icon indicating copy to clipboard operation
sequent copied to clipboard

Implement command middleware

Open bforma opened this issue 3 years ago • 2 comments

Usage:

class MyCommandMiddleware
  def call(command)
    # ...
    yield 
  end
end

Sequent.configure do |config|
  config.command_middleware.add(MyCommandMiddleware.new)
end

The middleware chain is invoked for each command passed to Sequent.configuration.command_service.execute_commands(...).

bforma avatar Sep 24 '21 12:09 bforma

I like the use of Middleware of the filters we currently use. This is also more inline with how e.g. Rack works with Middleware. We should add documentation for this and probably (later) deprecate command_filters in favor of this.

lvonk avatar Sep 24 '21 12:09 lvonk

I like the use of Middleware of the filters we currently use. This is also more inline with how e.g. Rack works with Middleware. We should add documentation for this and probably (later) deprecate command_filters in favor of this.

Yes, and we can also add some default middleware.

bforma avatar Sep 24 '21 13:09 bforma

Any word on this? We could use this.

bforma avatar Jan 19 '23 13:01 bforma

Yes, we do need some documentation for this, that would be really helpful 🙏🏼 . Is that something you can add?

lvonk avatar Jan 19 '23 13:01 lvonk

Sure.

bforma avatar Jan 19 '23 13:01 bforma

Can this be merged now?

bforma avatar Jan 20 '23 12:01 bforma