Skip to content

Redesign hook system #91

@mostafa

Description

@mostafa

The current hook system is very limited, especially that the hooks do not cover all the parts of the system and they are scattered all over the place, without any pre- and post-hooks. Another issue is that the current hooks are not added by dependency injection, rather manually, which means that if a new component is added, the hook system and hence the protocol buffer files should be updated, which is tedious and inextensible.
For example, currently there are three hooks for traffic passing through the system:

  1. OnTraffic happens as a notification to plugins that traffic is going to pass through, i.e. data is incoming.
  2. OnIngressTraffic happens when data is received from the client, aka. request.
  3. OnEgressTraffic happens when data returned from the DBMS server is being sent back to the client, aka. response.

In the above example, if a caching plugin is added, it needs to intercept incoming data, and possibly prevent any request from being sent to the DBMS server by returning the cached value to the client. This is not possible right now.

The hook system should be (re)designed to be more generic, so that new components can register new hooks, and those hooks can be immediately accessible to plugins right away without changes to the protocol buffer.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

🎉 Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions