You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
14For something much more complex than start-job/monitor-job-status I wouldn't go with REST. I'd use websockets. If without websockets I'd implement a long-polling (comet) endpoint so I can get real-time (within milliseconds) update from the server.slebetman– slebetman2020-08-02 00:30:02 +00:00Commented Aug 2, 2020 at 0:30
-
That is an excellent point and it's a direction I'm definitely considering. I think a websocket approach makes a lot of sense given the complexity. However, I wanted to compare it with a REST approach first to better understand how something like this might be implemented. I really like @hans-martin-mosner's approach of modeling jobs as resources. So, I may have the client API initialize the request and return a "handle" to the job via some kind of proxy job object. The job object could then directly communicate with the server over websockets and raise "server-prompt" events when they occur.meci– meci2020-08-02 03:02:39 +00:00Commented Aug 2, 2020 at 3:02
-
1Unfortunately I don't have the rep to answer, but... You could also register a URL for a callback when the processing is done. So, make the initial request, including a callback URL in the request. When the processing is done, the service running the process can hit the callback URL it was given, with the result of the operation. This keeps everything as a REST API, without any setup required for websockets. Not sure how 'pure' REST this is, but it's good enough for Microsoft docs.microsoft.com/en-us/partner-center/develop/…J Lewis– J Lewis2020-08-03 09:19:32 +00:00Commented Aug 3, 2020 at 9:19
-
Yet another possibility would be the use of push notifications. This would even allow the user to close the window and still receive notifications of completion/interaction required.jcaron– jcaron2020-08-04 10:52:17 +00:00Commented Aug 4, 2020 at 10:52
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you