From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.devel Subject: Re: [RFC] automatically retrying network connections Date: Sun, 22 Jul 2018 15:28:01 +0100 Message-ID: References: <87sh4dfz8r.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1532269622 17999 195.159.176.226 (22 Jul 2018 14:27:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2018 14:27:02 +0000 (UTC) Cc: Emacs-Devel devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 22 16:26:58 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhFK5-0004ZV-OH for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2018 16:26:57 +0200 Original-Received: from localhost ([::1]:56202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhFMC-0000Hv-H4 for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2018 10:29:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhFLX-0000HR-3X for emacs-devel@gnu.org; Sun, 22 Jul 2018 10:28:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhFLT-0006XK-8L for emacs-devel@gnu.org; Sun, 22 Jul 2018 10:28:27 -0400 Original-Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:40513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhFLT-0006X1-2X for emacs-devel@gnu.org; Sun, 22 Jul 2018 10:28:23 -0400 Original-Received: by mail-it0-x236.google.com with SMTP id h23-v6so867322ita.5 for ; Sun, 22 Jul 2018 07:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aPrzRkSTLZmoHsd+BAkwe72RkmHuIuofUF5qr88geEk=; b=TcI3cNhoONs+fDO2lhpcOQqVF9OoH6X+Wt8PjijDJ9rCnkr4K7YgWytc5XYRiWCPee 9G9awBLxzjy8fcsbjkC/7+Wc/BuYcb/mQdaG9n0r0194+ahVLefTO3pWfJSJM5icx9Nk jJi7u1OlwkVYtqKZ0CFAtWlLMTEDcdS8rw9uzQ3BLD3MAb3TiLF0yV4bqRPxfBcVXDIh qKmjnZj/a9RN12IkZcHQ6AfNdjnnhI4JgBJESFzWwcKtq0TKzBC1khLstg4XaR2EVlaM 7TcGjmAti68bibFvQE89puDskigSeXOpZqAtbCocN5EeH5OQMZO2vEWrCqyoiKlR2LIN X1uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aPrzRkSTLZmoHsd+BAkwe72RkmHuIuofUF5qr88geEk=; b=cSTeQ5La3yf0HgAbKA3AADKTMb5aVClrqQteD76X03xm2j1bz7Nx+cnoOWY3XsKHiy DrSVeUmJaHw8LftRyMHymeTf3ejaPuJrUzizZqpMi2ED1f10stbdPR+CyYLrfkdFBm3Q qhSp49PmJ5JxFIPSdXb5pVXMHaSNTkVoPZfDUoU/KNn3iCQb3Q2UwrSNcRZZtD/g9WIm cBNv6TUNoLavrvhUQKObmDZ1Goc7pDVIyM9kmRU8tp54ZNiup0wiPzV5FMjP5ALh0Pec 4vWzX/QDyfdm7WJ67cz/eYwG1GmXU9wj6tJ6UbF9T6MacMhInAjvFY2o20fD5uEVH7ch Metw== X-Gm-Message-State: AOUpUlF0l5lTXwx9SH6Y9TAdyitqUa7+OmJ1JdhAD1ZY6uJLmTlcI4KS GhPSCOvjlChye61abNSYEbToqIpJfcziGr0U8RlLpzog X-Google-Smtp-Source: AAOMgpeQzrvjI6eeByQym65WB0dizbIxX2gQrM1pO2mg0Iw3piO2Erq5x91tsYtY9YmtQZseq+WlY5/7Axprx8+nd/g= X-Received: by 2002:a02:7610:: with SMTP id z16-v6mr8548740jab.145.1532269702186; Sun, 22 Jul 2018 07:28:22 -0700 (PDT) Original-Received: by 2002:a02:985d:0:0:0:0:0 with HTTP; Sun, 22 Jul 2018 07:28:01 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227672 Archived-At: On Sun, Jul 22, 2018 at 11:28 AM, Lars Ingebrigtsen wrote: > Jimmy Yuen Ho Wong 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.