Enable the dynamic registration of context managers for request processing (i.e. event_tracking()
)
#18211
Labels
complexity: medium
Requires a substantial but not unusual amount of effort to implement
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v4.1.8
Feature type
Change to existing functionality
Triage priority
N/A
Proposed functionality
NetBox currently employs its
event_tracking()
context manager to process events triggered by a request, e.g. for change change logging. This function is invoked explicitly by theCoreMiddleware
class.Instead of calling this function directly, we can register it within NetBox's application registry, and consult the registry for all registered request processors whenever necessary, including within the middleware as well as for other purposes (such as running a background job).
Use case
This approach will enable to us to dynamically register additional request processors, such as those which may be introduced by plugins, without the need for explicit configuration. #18136 raises one such use case.
Database changes
N/A
External dependencies
N/A
The text was updated successfully, but these errors were encountered: