Conversation
components/promise.rst
Outdated
There was a problem hiding this comment.
what is the point of returning the response here? that will do nothin i think. maybe we should find a better example what to do.
There was a problem hiding this comment.
like updating a file or database with the contents of a json response
There was a problem hiding this comment.
Don't know, really. I copied this from the tutorial. 😉
There was a problem hiding this comment.
we should avoid duplication between doc. keep the tutorial minimal, or use a partial if the same example really makes sense (or just link)
There was a problem hiding this comment.
also, some redundancy in a tutorial chapter is ok - the references serve a different purpose and a tutorial without code examples and tons of links is not helpful. ideally the tutorial will "tell a story". it could mention working with promise as a side note as a tutorial on promise would be a large topic of its own...
There was a problem hiding this comment.
True: the tutorial should be a kind of story that is easy to follow. Too many links will distract too much and disrupt the flow.
There was a problem hiding this comment.
Well, duplication is bad from two points of view: content and maintenance. The former is arguable: for the sake of completeness, it might be good. If we can utilize partials to avoid maintenance of duplication, that's at least a half win.
There was a problem hiding this comment.
okay. but can we turn this into a minimal useful example? like write the response body into a file? returning something makes no sense at all.
|
great, thanks for starting this! |
There was a problem hiding this comment.
maybe we should mention that you could do several async requests in parallel and then wait for each (allowing the other requests to resolve while we wait)
There was a problem hiding this comment.
Isn't this happening in the batch client?
There was a problem hiding this comment.
Good point, as that is usually the idea of doing asynchronous requests.
There was a problem hiding this comment.
Let’s document this in a separate Batch client chapter.
There was a problem hiding this comment.
okay. we can add a note in this chapter when we add the batch client chapter.
|
great, thanks! |
There was a problem hiding this comment.
ups, already merged, but: @joelwurtz does returning the response make any sense here or should we just file_put_contents for the example? i assume the thing resolving the promise is not handling any return values?
No description provided.