TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Chained Promise: functional tools for recurring promises

15 pointsby chajathover 8 years ago

3 comments

resoluteteethover 8 years ago
I guess it was inevitable that Javascript support for this would lead to people yet again rediscovering the bad idea that is Seaside-style continuation-based web programming.<p>Please don&#x27;t actually do this. It completely violates all expectations of how both user-facing web servers and REST endpoints are supposed to behave.<p>The stateless nature of web programming is always frustrating, but attempts to use continuations to pretend a sequence of http requests can be treated as a single linear thread of execution simply don&#x27;t work.
评论 #12469468 未加载
emilongover 8 years ago
The example given in the readme (API pagination) seems better suited to an observable or stream to me, but it left me curious about applicability to other use cases with Promises.<p>One is retries on failure or timeout. The other is waiting for something to execute a certain number of times. The latter is something I&#x27;ve used only in tests, but it might have other uses I&#x27;m not thinking of. I&#x27;ve implemented both of these in the past with recursion, which is great, but scares some folks, esp when mixed with promises.
评论 #12467263 未加载
chajathover 8 years ago
Original author of the library here. Will take any questions and comments, thanks!<p>EDIT: After posting this I just found out the library isn&#x27;t compatible with the latest node release (6.5.0; still works well with 6.4.0). Will work with nodejs to see how we can address the problem.