whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] 01/02: send messages concurrently
Date Mon, 03 Oct 2016 14:38:31 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

commit 650aded376ab30bc6198740e125e10108059a4a6
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Oct 3 10:38:03 2016 -0400

    send messages concurrently
---
 www/board/agenda/daemon/wss.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/www/board/agenda/daemon/wss.rb b/www/board/agenda/daemon/wss.rb
index 528439a..47f7126 100755
--- a/www/board/agenda/daemon/wss.rb
+++ b/www/board/agenda/daemon/wss.rb
@@ -113,8 +113,13 @@ EM.run do
       headers = msg.slice!(/\A(\w+:\s*.*\r?\n)\s*(\n|\Z)/).to_s
       headers = YAML.safe_load(headers) || {} rescue {}
 
+      # echo message to all of the clients
       clients.each do |client|
-        client.send msg
+        EM.defer(
+          ->() {client.send msg},
+          ->(response) {},
+          ->(error) {client.close rescue nil}
+        )
       end
     end
   end

-- 
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <commits@whimsical.apache.org>.

Mime
View raw message