From a678bbc24a2363c06c3cfa20fe8a6313d2bb47d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Mon, 19 Jun 2017 11:01:49 +0200
Subject: [PATCH] CHANGES: Fixed Concurrent example.

User-level code should typically receive Concurrent.Future objects
(not Concurrent.Promise objects).

Use the usual naming convention (renamed connection() to connect()).

Also some other minor fixes for changes since Pike 8.0.438.
---
 CHANGES | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/CHANGES b/CHANGES
index 30208c2052..b9d9b994ad 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,12 +6,12 @@ New Features
 
 o Concurrent
 
-  The Concurrent module simplify asynchronous code by synchronizing
-  events in different ways. As an example the connection() function
-  shown will repond with Concurrent.Promise object that at some point
+  The Concurrent module simplifies asynchronous code by synchronizing
+  events in different ways. As an example the connect() function shown
+  below will repond with a Concurrent.Future object that at some point
   will represent either a connected socket or a failure.
 
-    Concurrent.Promise connection(string host, int port)
+    Concurrent.Future connect(string host, int port)
     {
       Stdio.File con = Stdio.File();
       Concurrent.Promise p = Concurrent.Promise();
@@ -25,35 +25,34 @@ o Concurrent
       {
         p->failure("Failed to open socket.\n");
       }
-      return p;
+      return p->future();
     }
 
-  The returned promise could the be used in various ways.
+  The returned future can then be used in various ways.
 
     // On success, call make_request(con, query). On failure call
     // werror(msg).
-    connection(host, port)
+    connect(host, port)
       ->on_failure(werror)
       ->on_success(make_request, query);
 
     // On success, call make_request(con, query1) followed by
     // make_request(resp, query2), where resp is the return value from
     // make_reqest.
-    connection(host, port)
+    connect(host, port)
       ->then(make_request, werror, query1)
       ->then(make_request, werror, query2);
 
     // Call bridge_ports(con1, con2) when both connections are
     // established.
-    Concurrent.all(connection(host1, port1), connection(host2, port2))
+    Concurrent.all(connect(host1, port1), connect(host2, port2))
       ->then(bridge_ports, failure);
 
     // Call make_request(con) once either of the connections are
     // established.
-    Concurrent.race(connection(host1, port1), connection(host2, port2))
+    Concurrent.race(connect(host1, port1), connect(host2, port2))
       ->then(make_requet, query);
 
-
 Bug fixes
 ---------
 
@@ -73,10 +72,12 @@ o ADT.Heap
 
 o Inotify
 
-  - Addressed an issue where the backend might be stuck in pending
-    indefinitely.
+  Addressed an issue where the backend might be stuck in pending
+  indefinitely.
+
+o FSEvents
 
-  - EventStreamMonitor now works with other backends.
+  EventStreamMonitor now works with other backends.
 
 o Standards.BSON
 
-- 
GitLab