[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] automatically retrying network connections
From: |
Jimmy Yuen Ho Wong |
Subject: |
Re: [RFC] automatically retrying network connections |
Date: |
Sun, 22 Jul 2018 15:28:01 +0100 |
On Sun, Jul 22, 2018 at 11:28 AM, Lars Ingebrigtsen <address@hidden> wrote:
> Jimmy Yuen Ho Wong <address@hidden> writes:
>
>> I'm currently using generators to alleviate UI blocking a bit, but I
>> haven't found a good answer to making async network processes and then
>> joining their results later. (short of writing a giant block of
>> callback spagetti anyway...)
>
> You want to do a bunch of async HTTP calls, and when they're all
> complete (including possibly some tryLaters), then you finish the entire
> thing? I don't really see the problem... can't you just create a queue
> (a la url-queue), or if you want to do all the calls in parallel, just
> create a structure all the threads fill in and the last one that
> finishes does the "complete" action?
>
The latter, parellel requests, and then join the results when they all
come back. I've come up with some bastardization of MapReduce now, but
this would be a lot nicer if Emacs had something like
https://github.com/chuntaro/emacs-promise built in, so I can combine
it with a generator to emulate async/await semantics.
Re: [RFC] automatically retrying network connections, Lars Ingebrigtsen, 2018/07/22