Comments (6)
@jzimmek,
Out of curiousity, how would you propose webhook to handle this? Do you mean for webhook to hold HTTP requests open/idle until your blocking script finishes? Or are you expecting webhook to queue the hook request (internally) and immediately respond to the request with a HTTP 200 success code?
I would suggest writing a simple shell command to add requests/jobs to Redis (persistent storage), and then have an app that empties the redis queue one job at a time.
from webhook.
As a late note to this ticket, maybe it can be helpful to some:
I used task spooler to queue tasks triggered by webhook calls, which worked nicely.
In my use case I did not want additional tasks to be queued if there is already one queued (as all tasks perform the same action). This was also easily possible using task spooler by checking the status of the last task that has been added.
from webhook.
It does so in parallel, launching shell command for every successful trigger. It is intended to act as a bridge between HTTP and shell. Following the unix philosophy, the queuing and locking system should be done as a separate tool that does just that thing and does well. :-)
from webhook.
If you happen to develop such tool I would gladly link to it in the webhook README page :-)
from webhook.
I would propose to support at least some control over how concurrency in webhook is handled. Without knowing about the inner details of webhook I would add
- Add new webhook parameter "concurrency_strategy", which defines the global (default) behavior for all hooks
- Add new property "concurrency_strategy" in the hook definition, which allows to define the behavior per hook
The following concurrency strategies come to mind:
-
"parallel", the default, which behaves as is now
-
"skip", does not execute command if an existing hook command (same hook id) is already running. but respond with http 200
-
"fail", does not execute command if an existing hook command (same hook id) is already running. but respond with http 500
-
and 3) will already solve a lot of use cases and should be fairly easy to implement.
The idea of having some queueing system sounds somehow nice, but I see your point that this might be a better fit for a different tool and not be part of webhook itself.
Nevertheless, having a "concurrency_strategy" flag in place, I would think about an additional option:
- "custom", this strategy will communicate with some external script/command. Not sure how this should behave in detail or if it is really necessary, but it would at least fit into this "concurrency_strategy" thing.
from webhook.
At the moment I do not have much time available on my hands, so I won't be implementing this, at least not anytime soon :-(
If you would like to contribute and implement the proposed solution, I would be more than glad to review your code and merge it.
Cheers! 👍
from webhook.
Related Issues (20)
- If my boolean value is not quoted, will it be matched HOT 1
- Webhook doesn't get triggered when behind a traefik reverse proxy HOT 3
- Broadcasting Slack Slash Command's Response HOT 1
- Header evaluation is broken HOT 4
- Step-by-step tutorial for a 'Hello world'
- Vulnerabilities of dependency "gopkg.in/yaml.v2"
- webhook hook not running bash script HOT 6
- Bitbucket now supports webhook secrets 🥳 HOT 1
- I found that I can't use dot-notation to contain all sub-objects in my json
- I need to parse url for addr:port HOT 1
- Update `go` installation
- Ubuntu Webhooks is not reading the correct RVM ruby installed HOT 2
- Custom logging
- Webhook id is not being served in URL HOT 2
- how to set shell $PATH HOT 4
- Weird Cert issue when calling webhook from shell HOT 1
- pass-file-to-command as optional HOT 1
- Add a (unique) folder with images for dynamic responses HOT 7
- Question - How long does the webhook service run
- Add hook property to control command output logging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhook.