-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
WIP: Support asynchronous operations (promises) #81
Conversation
Operations can now: 1) return their progress directly. 2) throw an error. 3) (ADDED) return a promise: + that resolves to their progress. + that rejects an error message (like throwing but asynchronous). For an example see the new operation "Wait" (Flow Control) Added a flow control operation "Wait", which waits for the number of milliseconds passed in as its argument. It is a fairly useless operation but it does demonstrate how asynchronous operations now work. A recipe like: ``` Fork Wait (1000ms) ``` will only wait for 1000ms (each wait runs at the same time as each other). I have not looked into performance implications yet, also this code is probably more complicated than it needs to be (would love help on this).
This is brilliant work and something that I've wanted to get sorted out for a while. When I've got a bit of spare time I'll go through it in detail and try to find edge cases where it causes problems, but for now just wanted to give a big thumbs up. We'll definitely get this merged once we've had a chance to test it thoroughly. |
If fork was called with no following operations, progress was undefined, this caused an infinite loop.
Because this is a big change it would seem like a good time to add some functionality for testing operations. To keep with the very simple and lightweight structure of CyberChef it would be nice to not have to pull in tools like Selenium and PhantomJS just to test operations. I hacked together a quick implementation to help test the above changes and I think it makes sense to actually have this functionality permanently (and for all operations). My very simple implementation.
The actual CyberChef code doesn't have to be modified to enable this functionality because of the separation of the actual
Tests are currently defined (all together) in a list, each test is defined like so:
The The The Should I commit it (after cleaning it the code a bit), if so, should I put it here or in another PR? |
Another thing I can take off my to do list. Yes, definitely commit this. I'd put it in a separate pull request as it's not strictly linked to this one. |
Glad to lighten the load; moved this into it's own PR #84. |
I have made a few largely aesthetic changes and created a new branch,
For now I will close this PR - all new work should be merged into |
…fdd784c06a7012a0 [Snyk] Upgrade vue-material-tabs from 0.0.7 to 0.1.2
Summary
More details in #79
I've managed so far to keep it as backwards compatible as possible, there are no configuration changes needed for any operations.
Functionality example
An operation could only look like this before:
But if
doSomething
was asynchronous then we would not be able to use it...Now we can also do:
Operational example
I have added an operation called "Wait", this is what it looks like when an operation is in progress:

I'd love your feedback on how I can improve this, or if you find any bugs (and because it is quite a large functionality change I do expect there to be some fiddly edge-cases).