Asynchronous Instance and binding create/delete operations#48
Open
danail-branekov wants to merge 1 commit into
Open
Asynchronous Instance and binding create/delete operations#48danail-branekov wants to merge 1 commit into
danail-branekov wants to merge 1 commit into
Conversation
Create delete opertations submit tasks to the common fork-join pool to
implement asynchronous processing.
When creating:
* if the object being created already exists -> response with the object
is returned
* otherwise,
- a task is submitted to the common fork-join pool
- the task is registered into a local synchronised map using the
opearation name as key
- async response is returned (resulting into `HTTP 202 Accepted`
response)
When getting the last operation
* if a fork-join pool task with the operation name specified in the
request does not exist, throw a
`ServiceBrokerInvalidParametersException`
* Otherwise,
- if the task has not completed, `in progress` response is returned
- if the task has completed successfully, `succeess` is returned
- if the task has failed, `failed` is returned
- regardless is the task has succeeded or failed, it is deregistered
from the `task` map
When deleting
* if the resource does not exist, throw `XXXDoesNotExistException`
resulting into a `HTTP 410 Gone` response code
* otherwise
- a task is submitted to the common fork-join pool
- the task is registered into a local synchronised map using the
opearation name as key
- async response is returned (resulting into `HTTP 202 Accepted`
response)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While implementing our OSBAPI client in Korifi, we needed to test our implementation against an async broker. We could not find one easily, therefore we changed the sample bookstore broker to create/delete instances and bindings asynchronously.
We thought that it might be useful to contribute that increment back to the upstream, so here is the PR.
There are few issues with the PR though (I am not a Java developer, so please tolerate me):
Before I carry on trying to iron those out, I would like to ask whether you are willing the merge such a PR at all. What do yuo think?