Skip to content

Add support for dependency injection to the websocket module #775

@Kaliumhexacyanoferrat

Description

@Kaliumhexacyanoferrat

As a developer using the websocket module, I would like to use dependency injection to register both my handler implementation as well as initialize it with dependencies being injected.

Example

var websocket = Websocket.Reactive()
                         .DependentHandler<MyHandlerType>() // interface or class, resolved via DI
                         .DependentHandler(); // an implementation of IReactiveHandler, resolved via DI

Additional, the default way of instantiating a non-DI handler should be one per connection, not one per handler. This would allow users to save state in the handler instance.

Acceptance criteria

  • The functionality is added within the dependency injection module
  • The default way of providing an instance is changed to per-connection instead of per-handler
  • The feature is documented on the GenHTTP website
  • The feature is covered by acceptance tests

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions