summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/threads.js b/threads.js
index bc8e429..2d1ce77 100644
--- a/threads.js
+++ b/threads.js
@@ -1298,6 +1298,15 @@ Process.prototype.doRemoveTemporaries = function () {
// Peer to peer primitives
Process.prototype.sendPeerMessage = function (message, peer) {
+ var myself = this;
+
+ if (peer instanceof List) {
+ peer.asArray().forEach(function (singlePeer) {
+ myself.sendPeerMessage(message, singlePeer);
+ });
+ return;
+ }
+
var stage = this.homeContext.receiver.parentThatIsA(StageMorph),
ide = this.homeContext.receiver.parentThatIsA(IDE_Morph);
var connection = stage.peer.connect(peer, {reliable: true});