Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Task Prerequest "Middleware" #361

Open
pr1sm opened this issue Feb 25, 2019 · 1 comment
Open

Add Task Prerequest "Middleware" #361

pr1sm opened this issue Feb 25, 2019 · 1 comment
Labels
area:task-runner Related to Nebula's Task Runner package focus:monitor things involving site monitoring priority:low Issues that are low priority don't need to be solved right away type:enhancement New feature or request

Comments

@pr1sm
Copy link
Collaborator

pr1sm commented Feb 25, 2019

Is your feature request related to a problem? Please describe.
Both #321 and #360 share a similar structure for the notion of a pre-request shortciruit. The only difference is the aspect of the request they are looking at. Instead of having two issues come up with potentially different solutions, we should have a general structure that can be used by both.

Describe the solution you'd like
Both of these issues (and potentially other related) track very similarly to the idea of a request "middleware" chain. This is very similar to how redux offers a middleware chain for handling issues, or express offers a middleware chain for handling incoming web requests.

A similar middleware chain logic should be implemented for us to use when making a request from the monitor. This would be broken down in 3 parts

Step 1: Implementing middleware chaining logic and registration

We need to implement the logic for registering middleware onto a chain, as well as passing the request through the chain. This must be done before any changes to the monitor can be made to use it. At a high-level, we would need a register method to add middleware to the chain. When a request is made, we use the chain to either shortcircuit with a predefined response, or reach the end of the chain that makes the actual request.

Step 2: Using the middleware chain API

At a high level, this step would involve changing any monitor-related request methods to using the middleware chain api implemented in Step 1.

Step 3: Implementing middleware

This step would not be included in addressing this issue, but would addressed in the individual issues that call for this backbone structure (issues #321 and #360 at the time of making this issue)

Describe alternatives you've considered
I haven't considered any at this time, but I'm open to any suggestions!

Additional context
Before addressing this issues, we should have a plan for the proposed middleware chain API functions and their parameters. This would help us greatly in step 2 since we would know what each function does and what it requires.

@pr1sm pr1sm added type:enhancement New feature or request area:task-runner Related to Nebula's Task Runner package focus:monitor things involving site monitoring priority:low Issues that are low priority don't need to be solved right away labels Feb 25, 2019
@walmat
Copy link
Owner

walmat commented Mar 7, 2019

Bumping this from priority:low to priority:high

@walmat walmat added priority:high Issues that are high priority, but don't need to be solved ASAP and removed priority:low Issues that are low priority don't need to be solved right away labels Mar 7, 2019
@walmat walmat added priority:low Issues that are low priority don't need to be solved right away and removed priority:high Issues that are high priority, but don't need to be solved ASAP labels Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:task-runner Related to Nebula's Task Runner package focus:monitor things involving site monitoring priority:low Issues that are low priority don't need to be solved right away type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants