Skip to content

Limitations of channels.EventBus #2

@jonathandung

Description

@jonathandung

The current middleware system of channels.EventBus remembers the order of the middlewares, which is usually crucial to getting the correct data across. It does not, however, allow insertion at any position, which is sometimes desirable.

Also, O(1) insertion and removal of middlewares means that the middleware must be a hashable callable. For unhashable callables, functions must be made to wrap them, which is annoying.

Besides, the underlying implementation (using a hash map) disallows duplicate middlewares. Again, to work around this, wrapper functions must be used in place of the function containing the processing steps. This is troublesome.

However, a method to get the best of both worlds (performance and flexibility) is not known.

Metadata

Metadata

Assignees

Labels

known limitationNot a bug, but suboptimal performance. Discussions welcome. Link this issue in the PR when fixing.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions