{"_id":"q-comm","_rev":"32-0deca458562d555aa78736550b69b00e","name":"q-comm","description":"Q-Comm has been renamed Q-Connection","dist-tags":{"latest":"0.5.0"},"versions":{"0.0.0":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.0.0","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.0","uuid":">=0.0.2","socket.io":"0.6.0"},"_id":"q-comm@0.0.0","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.2.1","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.0.0.tgz","shasum":"106f0386477cbf8c8259451413d25e01c3fd8b17","integrity":"sha512-4sLDiNE6TU4bjti6Z/+iXCqWLREsXv8eIFGiYmcMoEztDzyi2At+1k86tFQEL6oYGRs9NO2IpDon70ocsseonQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHNvjCdFaQSMES/1v8j3oWGCvxJ2NBWeEQd5TBV+RbMAiAhd0Ql6QTkWsRSg6cf9ENJbH5O+QR60BpunqsNuqhTLQ=="}]}},"0.0.1":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.0.1","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.1","uuid":">=0.0.2","socket.io":"0.6.0"},"_id":"q-comm@0.0.1","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.2.1","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.0.1.tgz","shasum":"bac238168d98bac768b3ccc40114c3ea2969f224","integrity":"sha512-Psk3NOfYXK9tY2Nq0+zDPnNg8udF40um4SWIgLOoRrfs6Qt0cZqxuQdEmtrFh/UVjiP6rHT9xcPXcQB+E1kAjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAGas3bxEaPPfZ7FHPlQLrLEgvmr45u4uBzgGC4n+tr1AiB+g7yVuG+v5N4x/vLoC6cVY2S+iTwvs6sIWRanzITJOg=="}]}},"0.0.2":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.0.2","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.1","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1"},"_id":"q-comm@0.0.2","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.2.1","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.0.2.tgz","shasum":"4fbb6b3f27e3d88413f050d1b6fd23bd3320f88d","integrity":"sha512-ElXQc0+5f9ofuMISw/x6LjF9w1JfNRsz0C0wgOCWr6BqIPrCDltx0h/CVaSJZ8DDuxYz/1wy7ZvbVEh7x2Vszw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFN8chwYQGfLqgZ8zdq/qWwSSniO5n9Lxaoc151tFQBPAiBDZxq4SIDeuAbday1h2l5j4ojiiPvmBQy/YkbWKqzBCg=="}]}},"0.0.3":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.0.3","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.2","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1"},"_id":"q-comm@0.0.3","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.2.1","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.0.3.tgz","shasum":"ca739247791a89c16d91a227eb0056b122389733","integrity":"sha512-JZVWxiUZLSX/FpTbkq89AUJPHE0mhxzGgM339fMC+laj2O+fDOP+3rxW0+j5vrHsjvI9jwMaOddvJRq3wwiZ+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrB94OBk0+z+eawE/2pFEa7ORvikXeiwi9xMMM5U5skAiAUaR1A8WiCEkhTDRe6FJj5s3m8Ae+AAsbW75BNFGElyg=="}]}},"0.1.0":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.1.0","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages","socket.io-server":"./lib/q-comm/socket.io-server"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.2","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1"},"_id":"q-comm@0.1.0","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.2.1","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.1.0.tgz","shasum":"bee77e521d741c5f0b00f363f5405a0a02e95c7b","integrity":"sha512-OJtDk0vgVbOeXGCAG2+Gu2MhEgYOKcpWsGIESZon2Gjbmx5xuwGJ73ChC05JdamRcPcSPieotJXiiGydq3tklw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+oJ6Z9t/MQC7bpo+ne4rF/Q2S0HSjt5xEfkjS+wWWRAiAeQz/TOBDOlVNqW9NMzw3x700yBBNtot7pn6OaB0ZxfA=="}]}},"0.1.1":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.1.1","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages","socket.io-server":"./lib/q-comm/socket.io-server"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0"},"dependencies":{"q":">=0.2.5","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1"},"_id":"q-comm@0.1.1","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.3.3","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.1.1.tgz","shasum":"0970e946989b73956e735f4b21f0a849b75c3808","integrity":"sha512-RRMieqSfUtYfg6PrA6g2USphe5pnESeOCYtw+fLk0xtAKAiT4/zFt140rL3y27bOdSWaJIpFltOvobRKVqTjmQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPmp/74Fyf81Gqp1X6bOJjsYqCzEOof02In0+/QuSDmgIhANQB+n7QfIn8fKao7oGpoSpbQSm6nSUs21RlidZ2WB2i"}]}},"0.1.2":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.1.2","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Mark Miller","email":"erights@google.com"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"bugs":{"mail":"kris@cixar.com","web":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"lib/q-comm","dependencies":{"q":">=0.2.5","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1","test":"0.0.10"},"overlay":{"node":{"modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages","socket.io-server":"./lib/q-comm/socket.io-server"},"dependencies":{"q":">=0.2.5","uuid":">=0.0.2","socket.io":"0.6.0","n-util":"0.0.1","test":"0.0.10"},"scripts":{"test":"node test/all.js"}}},"repository":{"type":"git","url":"http://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"modules":{"webworker":"./lib/q-comm/webworker","messages":"./lib/q-comm/messages","socket.io-server":"./lib/q-comm/socket.io-server"},"scripts":{"test":"node test/all.js"},"_id":"q-comm@0.1.2","_nodeSupported":true,"_npmVersion":"0.2.5-1","_nodeVersion":"v0.3.3","dist":{"tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.1.2.tgz","shasum":"d5cba839abcf07f5a99cc456911c0a466f373f58","integrity":"sha512-HCvWxbmF3f2E7nzwcQDhlw/qYjInzSDo/xhdz5G4HiRrhytD5bf8gsn2Hv00+zt5HRwTcMGIulXiE6gLMP8mwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArrh/6ssdmTDcYjIMG/hwKx4vHZnN9iJ+P1zT24VnSoAiB65gRgo+z3JzHgGZqIO03gmKDIzq/1Eudln4ML51xOQg=="}]}},"0.2.0":{"name":"q-comm","description":"An inter-worker asynchronous promise communication system.","version":"0.2.0","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"email":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":">=0.4.0","qq":">=0.1.0","uuid":">=0.0.2"},"devDependencies":{"test":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"_id":"q-comm@0.2.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"874f9de8995f6e0971f4fefce5e4a3a8e42d5852","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.2.0.tgz","integrity":"sha512-hNi7Q4n46XK2LPJTJeZMcfuCa1OIv6MAjxjZhRra2P81c5Ms4wPuizRZZfgBGNH1UxJmjPZbiXYMkVvDy8VuJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0YxbYXShTJM22/g5oreOAs6qYpAF3L7V/QIYwPd8bvAiEA6ZSWNNpDD+kI+FGaM7omgb70bB7alqI7lIT+G69IqJg="}]}},"0.3.0":{"name":"q-comm","version":"0.3.0","description":"An inter-worker asynchronous promise communication system.","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"email":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":"0.8.0","uuid":">=0.0.2"},"devDependencies":{"test":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"_id":"q-comm@0.3.0","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"3ca16fe8378014769375ed566a13b4097aca9315","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.3.0.tgz","integrity":"sha512-8fNzsYYvfekZxlEOCLVSNXIyvgGwmbIvRUnrE4VTcmcUWwb/9elLVUJOEZ4ryQkoNs07AxJeDjbSItpLntAHEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXCEVxDNxU8dNPULzzGsfAw15wDz+oDvp+dNSIHnNq6AiEAgnS9RGzBzlyzMaZ5VPXOosQavNsdnd05NsUJwg7efJE="}]},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]},"0.3.1":{"name":"q-comm","version":"0.3.1","description":"An inter-worker asynchronous promise communication system.","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"email":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":"0.8.0","uuid":">=0.0.2"},"devDependencies":{"test":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"_id":"q-comm@0.3.1","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"6344fd4468004399d60499fdbcf4042db36b3245","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.3.1.tgz","integrity":"sha512-QRmiiw8a8hZw7lPRzZlYGXhEvDuLEDRocooRZ+siwS7tQ15cqXMlDK4jxYMxtMCh9UUE+IOsOxbUTH5CIg5KzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3okQOKr3V+xTTJ+WFqhMMLjpUcI9wQJScdj6yhm7M5AIgJYJSBZ4ba78lrhAQQm1PIDO2zXTeumGiDAE761RjnHc="}]},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]},"0.4.0":{"name":"q-comm","version":"0.4.0","description":"An inter-worker asynchronous promise communication system.","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"mail":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":"0.8.x","collections":"0.0.x"},"devDependencies":{"test":">=0.1.0","event-queue":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"readme":"[![Build Status](https://secure.travis-ci.org/kriskowal/q-comm.png)](http://travis-ci.org/kriskowal/q-comm)\n\nAsynchronous Remote Objects\n---------------------------\n\nThis library makes it possible for objects to communicate\nasynchronously between memory-isolated JavaScript contexts,\nincluding pipelining interactions with results.  Promises\nserve as proxies for remote objects.\n\nQ-Comm works in Node and other CommonJS module loaders like\n[Browserify][], [Mr][], and [Montage][].\n\n[Q]: https://github.com/kriskowal/q\n[Browserify]: https://github.com/substack/node-browserify\n[Mr]: https://github.com/kriskowal/mr\n[Montage]: https://github.com/montagejs/montage\n\nThis is how it looks:\n\n```javascript\nvar Q = require(\"q\");\nvar Connection = require(\"q-comm\");\nvar remote = Connection(port, local);\n```\n\nThe ``remote`` object is a promise for the ``local`` object\non the other side of the connection.  Likewise, the other\nside of the connection will get a promise for your ``local``\nobject.  You are not obliged to provide a local object,\ndepending on which end of the connection is providing a\nservice.\n\nIf the ``remote`` or ``local`` object is not serializable,\nlike functions or objects with methods, the other side will\nreceive a promise but you will have to “send messages” to\nthe promise instead of interacting directly with the remote\nobject.  When you invoke a method on a remote object, you\nget a promise for the result and you can immediately\npipeline a method call on the result.  This is the secret\nsauce.\n\nThe ``port`` is any W3C message port, web worker, or web\nsocket.  In the W3C’s infinite wisdom, these do not have a\nunified API, but Q-Comm will normalize them internally.\n\n```javascript\n// To communicate with objects in a worker\nvar worker = new Worker(\"worker.js\");\nvar child = Connection(worker, local);\n```\n\n```javascript\n// Inside a worker, to communicate with the parent\nvar parent = Connection(this);\n```\n\n```javascript\n// To communicate with a remote object on the other side of\n// a web socket\nvar socket = new WebSocket(\"ws://example.com\");\nvar remote = Connection(socket, local);\n```\n\n```javascript\n// To communicate with a single frame on the same origin\n// (multiple frames will require some handshaking event sources)\nvar iframe = document.frames[0];\nvar child = Connection(iframe.contentWindow, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// To communicate with a parent frame on the same origin\nvar child = Connection(window, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// With a message port\nvar port = new MessagePort();\nvar near = Connection(port[0]);\nvar far = Connection(port[1]);\n```\n\nYour ``local`` value can be any JavaScript value, but it is\nmost handy for it to be an object that supports an API and\ncannot be serialized with JSON.\n\n```javascript\nvar Q = require(\"q\");\nvar counter = 0;\nvar local = {\n    \"next\": function () {\n        return counter++;\n    }\n};\n```\n\nIn this case, the local object has a \"next\" function that\nreturns incremental values.  Since the function closes on\nlocal state (the ``counter``), it can't be sent to another\nprocess.\n\nOn the other side of the connection, we can asynchronously\ncall the remote method and receive a promise for the result.\n\n```javascript\nremote.invoke(\"next\")\n.then(function (id) {\n    console.log(\"counter at\", i);\n});\n```\n\nThe connection is bi-directional.  Although you do not need\nto provide and use both ``local`` and ``remote`` values on\nboth sides of a connection, they are available.\n\nYou can asynchronously interact with any value using the Q\nAPI.  This chart shows the analogous operations for\ninteracting with objects synchronously and asynchronously.\n\n```\nsynchronous                asynchronous\n------------------         -------------------------------\nvalue.foo                  promise.get(\"foo\")\nvalue.foo = value          promise.put(\"foo\", value)\ndelete value.foo           promise.del(\"foo\")\nvalue.foo(...args)         promise.post(\"foo\", [args])\nvalue.foo(...args)         promise.invoke(\"foo\", ...args)\nvalue(...args)             promise.fapply([args])\nvalue(...args)             promise.fcall(...args)\n```\n\nAll of the asynchronous functions return promises for the\neventual result.  For the asynchronous functions, the value\nmay be any value including local values, local promises, and\nremote promises.\n\nThe benefit to using the asynchronous API when interacting\nwith remote objects is that you can send chains of messages\nto the promises that the connection makes.  That is, you can\ncall the method of a promise that has not yet been resolved,\nso that message can be immediately sent over the wire to the\nremote object.  This reduces the latency of interaction with\nremote objects by removing network round-trips.\n\nA chain of dependent operations can be contracted from:\n\n```\n<-client     server->\na..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nb..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nc..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\n```\n\nDown to:\n\n```\n<-client     server->\na..\nb..''--..\nc..''--..''--..\n   ''--..''--..''--..\n         ''--..--''..\n       ..--''..--''..\n ..--''..--''..--''\n ..--''..--''\n ..--''\n```\n\nWhere the dotted lines represent messages traveling through\nthe network horizontally, and through time vertically.\n\n\nPorts\n-----\n\nQ-Comm handles a variety of message ports or channel types.  They are\nall internally converted into a Q Channel.  If you are using a message\nchannel that provides a different API than this or a WebWorker,\nWebSocket, or MessagePort, you can adapt it to any of these interfaces\nand Q-Comm will handle it.\n\nThis is probably the simplest way to create a channel duck-type,\nassuming that you’ve got a connection instance of the Node variety.\n\n```javascript\nvar port = {\n    postMessage: function (message) {\n        connection.send(message);\n    },\n    onmessage: null // gets filled in by Q-Comm\n};\nconnection.on(\"message\", function (data) {\n    port.onmessage({data: \"\"})\n});\nvar remote = Connection(port, local);\n```\n\n## Q Channels\n\n-   ``get()`` returns a promise for the next message from the other\n    side of the connection.  ``get`` may be called any number of times\n    independent of when messages are actually received and each call\n    will get a promise for the next message in sequence.\n-   ``put(message)`` sends a message to the remote side of the\n    connection.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    sent.\n-   ``closed`` a promise that is fulfilled with the reason for closing.\n\nQ-Comm exports an indefinite ``Queue`` that supports this API which\ngreatly simplifies the implementation of adapters.\n\n-   ``get()`` returns a promise for the next value in order that is\n    put on the queue.  ``get`` may be called any number of times,\n    regardless of whether the corresponding value is put on the queue\n    before or after the ``get`` call.\n-   ``put(value)`` puts a message on the queue.  Any number of\n    messages can be put on the queue, indepent of whether and when the\n    corresponding ``get`` is called.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    put on the queue and that any promises for such messages must be\n    rejected with the given reason.\n-   ``closed`` a promise that is fulfilled when and if the queue has\n    been closed.\n\n## Web Workers and Message Ports\n\nQ-Comm detects ports by their ``postMessage`` function.\n\n-   ``postMessage(message)``\n-   ``onmessage(handler(message))``\n\n## Web Sockets\n\nQ-Comm detects Web Sockets by their ``send`` function.  It takes the\nliberty to start the socket and listens for when it opens.\n\n-   ``send(message)``\n-   ``addEventListener(event, handler(event))``\n-   ``start()``\n-   ``open`` event\n-   ``close`` event\n\nMemory\n------\n\nQ-Comm uses an LRU cache of specified size.  The default size is\ninfinite, which is horribly leaky.  Promises between peers will stick\naround indefinitely.  This can be trimmed to something reasonable with\nthe ``max`` option.\n\n```javascript\nvar remote = Connection(port, local, {max: 1024});\n```\n\nThe least frequently used promises will be collected.  If the remote\nattempts to communicate with a collected promise, the request will be\nrejected.  This is fine if you have code in place to recover from\nrejections that will revive the working set of promises.  The minimum\nworking set will vary depending on the load on your service.\n\n","_id":"q-comm@0.4.0","dist":{"shasum":"7f7f48fe1d29d0a4e6f4d06ed44d27d401f8ef9a","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.4.0.tgz","integrity":"sha512-nBDJXEzVuqYX6wMFwnXB1eV9MXiNXi5vI6iOTdUvefidWNhVJgOB+s7r/G9oWVnFXtf4crRNrNu3ywhR3nldFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrQYc68moEKo/wrdrWoz89Mj3mSoMYXea8qTUm5MEqpwIhAKdEZQTaG7/jLVxs14MG7em9ZXs6Yf4Edc2ftRSm6gJj"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]},"0.4.1":{"name":"q-comm","version":"0.4.1","description":"An inter-worker asynchronous promise communication system.","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"mail":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":"0.8.x","collections":"0.0.x"},"devDependencies":{"test":">=0.1.0","event-queue":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"readme":"[![Build Status](https://secure.travis-ci.org/kriskowal/q-comm.png)](http://travis-ci.org/kriskowal/q-comm)\n\nAsynchronous Remote Objects\n---------------------------\n\nThis library makes it possible for objects to communicate\nasynchronously between memory-isolated JavaScript contexts,\nincluding pipelining interactions with results.  Promises\nserve as proxies for remote objects.\n\nQ-Comm works in Node and other CommonJS module loaders like\n[Browserify][], [Mr][], and [Montage][].\n\n[Q]: https://github.com/kriskowal/q\n[Browserify]: https://github.com/substack/node-browserify\n[Mr]: https://github.com/kriskowal/mr\n[Montage]: https://github.com/montagejs/montage\n\nThis is how it looks:\n\n```javascript\nvar Q = require(\"q\");\nvar Connection = require(\"q-comm\");\nvar remote = Connection(port, local);\n```\n\nThe ``remote`` object is a promise for the ``local`` object\non the other side of the connection.  Likewise, the other\nside of the connection will get a promise for your ``local``\nobject.  You are not obliged to provide a local object,\ndepending on which end of the connection is providing a\nservice.\n\nIf the ``remote`` or ``local`` object is not serializable,\nlike functions or objects with methods, the other side will\nreceive a promise but you will have to “send messages” to\nthe promise instead of interacting directly with the remote\nobject.  When you invoke a method on a remote object, you\nget a promise for the result and you can immediately\npipeline a method call on the result.  This is the secret\nsauce.\n\nThe ``port`` is any W3C message port, web worker, or web\nsocket.  In the W3C’s infinite wisdom, these do not have a\nunified API, but Q-Comm will normalize them internally.\n\n```javascript\n// To communicate with objects in a worker\nvar worker = new Worker(\"worker.js\");\nvar child = Connection(worker, local);\n```\n\n```javascript\n// Inside a worker, to communicate with the parent\nvar parent = Connection(this);\n```\n\n```javascript\n// To communicate with a remote object on the other side of\n// a web socket\nvar socket = new WebSocket(\"ws://example.com\");\nvar remote = Connection(socket, local);\n```\n\n```javascript\n// To communicate with a single frame on the same origin\n// (multiple frames will require some handshaking event sources)\nvar iframe = document.frames[0];\nvar child = Connection(iframe.contentWindow, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// To communicate with a parent frame on the same origin\nvar child = Connection(window, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// With a message port\nvar port = new MessagePort();\nvar near = Connection(port[0]);\nvar far = Connection(port[1]);\n```\n\nYour ``local`` value can be any JavaScript value, but it is\nmost handy for it to be an object that supports an API and\ncannot be serialized with JSON.\n\n```javascript\nvar Q = require(\"q\");\nvar counter = 0;\nvar local = {\n    \"next\": function () {\n        return counter++;\n    }\n};\n```\n\nIn this case, the local object has a \"next\" function that\nreturns incremental values.  Since the function closes on\nlocal state (the ``counter``), it can't be sent to another\nprocess.\n\nOn the other side of the connection, we can asynchronously\ncall the remote method and receive a promise for the result.\n\n```javascript\nremote.invoke(\"next\")\n.then(function (id) {\n    console.log(\"counter at\", i);\n});\n```\n\nThe connection is bi-directional.  Although you do not need\nto provide and use both ``local`` and ``remote`` values on\nboth sides of a connection, they are available.\n\nYou can asynchronously interact with any value using the Q\nAPI.  This chart shows the analogous operations for\ninteracting with objects synchronously and asynchronously.\n\n```\nsynchronous                asynchronous\n------------------         -------------------------------\nvalue.foo                  promise.get(\"foo\")\nvalue.foo = value          promise.put(\"foo\", value)\ndelete value.foo           promise.del(\"foo\")\nvalue.foo(...args)         promise.post(\"foo\", [args])\nvalue.foo(...args)         promise.invoke(\"foo\", ...args)\nvalue(...args)             promise.fapply([args])\nvalue(...args)             promise.fcall(...args)\n```\n\nAll of the asynchronous functions return promises for the\neventual result.  For the asynchronous functions, the value\nmay be any value including local values, local promises, and\nremote promises.\n\nThe benefit to using the asynchronous API when interacting\nwith remote objects is that you can send chains of messages\nto the promises that the connection makes.  That is, you can\ncall the method of a promise that has not yet been resolved,\nso that message can be immediately sent over the wire to the\nremote object.  This reduces the latency of interaction with\nremote objects by removing network round-trips.\n\nA chain of dependent operations can be contracted from:\n\n```\n<-client     server->\na..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nb..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nc..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\n```\n\nDown to:\n\n```\n<-client     server->\na..\nb..''--..\nc..''--..''--..\n   ''--..''--..''--..\n         ''--..--''..\n       ..--''..--''..\n ..--''..--''..--''\n ..--''..--''\n ..--''\n```\n\nWhere the dotted lines represent messages traveling through\nthe network horizontally, and through time vertically.\n\n\nPorts\n-----\n\nQ-Comm handles a variety of message ports or channel types.  They are\nall internally converted into a Q Channel.  If you are using a message\nchannel that provides a different API than this or a WebWorker,\nWebSocket, or MessagePort, you can adapt it to any of these interfaces\nand Q-Comm will handle it.\n\nThis is probably the simplest way to create a channel duck-type,\nassuming that you’ve got a connection instance of the Node variety.\n\n```javascript\nvar port = {\n    postMessage: function (message) {\n        connection.send(message);\n    },\n    onmessage: null // gets filled in by Q-Comm\n};\nconnection.on(\"message\", function (data) {\n    port.onmessage({data: \"\"})\n});\nvar remote = Connection(port, local);\n```\n\n## Q Channels\n\n-   ``get()`` returns a promise for the next message from the other\n    side of the connection.  ``get`` may be called any number of times\n    independent of when messages are actually received and each call\n    will get a promise for the next message in sequence.\n-   ``put(message)`` sends a message to the remote side of the\n    connection.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    sent.\n-   ``closed`` a promise that is fulfilled with the reason for closing.\n\nQ-Comm exports an indefinite ``Queue`` that supports this API which\ngreatly simplifies the implementation of adapters.\n\n-   ``get()`` returns a promise for the next value in order that is\n    put on the queue.  ``get`` may be called any number of times,\n    regardless of whether the corresponding value is put on the queue\n    before or after the ``get`` call.\n-   ``put(value)`` puts a message on the queue.  Any number of\n    messages can be put on the queue, indepent of whether and when the\n    corresponding ``get`` is called.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    put on the queue and that any promises for such messages must be\n    rejected with the given reason.\n-   ``closed`` a promise that is fulfilled when and if the queue has\n    been closed.\n\n## Web Workers and Message Ports\n\nQ-Comm detects ports by their ``postMessage`` function.\n\n-   ``postMessage(message)``\n-   ``onmessage(handler(message))``\n\n## Web Sockets\n\nQ-Comm detects Web Sockets by their ``send`` function.  It takes the\nliberty to start the socket and listens for when it opens.\n\n-   ``send(message)``\n-   ``addEventListener(event, handler(event))``\n-   ``start()``\n-   ``open`` event\n-   ``close`` event\n\nMemory\n------\n\nQ-Comm uses an LRU cache of specified size.  The default size is\ninfinite, which is horribly leaky.  Promises between peers will stick\naround indefinitely.  This can be trimmed to something reasonable with\nthe ``max`` option.\n\n```javascript\nvar remote = Connection(port, local, {max: 1024});\n```\n\nThe least frequently used promises will be collected.  If the remote\nattempts to communicate with a collected promise, the request will be\nrejected.  This is fine if you have code in place to recover from\nrejections that will revive the working set of promises.  The minimum\nworking set will vary depending on the load on your service.\n\n","_id":"q-comm@0.4.1","dist":{"shasum":"0d46b27ee9ce0456a09258bb95a0a3a385159ae6","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.4.1.tgz","integrity":"sha512-/fcunbh6DP6bnoQo6Oy9NmkhtLt+uizEFJ9t9ley3G1rmvIuVpdm6thIrVb24+xr3QgRrowJ5R9gOVHgy1gzLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLHhwph/hAvx5HJ3s4w7TWjsCmro/kLKjcgYDAiotg6QIgdR6qCl48fVLd5E8JT3hwCvxU0R+NBHvsf4KvMu8GRQY="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]},"0.4.2":{"name":"q-comm","version":"0.4.2","description":"An inter-worker asynchronous promise communication system.","homepage":"http://github.com/kriskowal/q-comm/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"contributors":[{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com/"}],"credits":["Mark Miller <erights@google.com>"],"bugs":{"mail":"kris@cixar.com","url":"http://github.com/kriskowal/q-comm/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-comm/raw/master/LICENSE"}],"main":"q-comm.js","dependencies":{"q":"0.8.x >=0.8.10","collections":"0.0.x"},"devDependencies":{"test":">=0.1.0","event-queue":">=0.1.0"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"},"engines":{"node":">=0.2.0","jetpack":">=0.9.0"},"readme":"[![Build Status](https://secure.travis-ci.org/kriskowal/q-comm.png)](http://travis-ci.org/kriskowal/q-comm)\n\nAsynchronous Remote Objects\n---------------------------\n\nThis library makes it possible for objects to communicate\nasynchronously between memory-isolated JavaScript contexts,\nincluding pipelining interactions with results.  Promises\nserve as proxies for remote objects.\n\nQ-Comm works in Node and other CommonJS module loaders like\n[Browserify][], [Mr][], and [Montage][].\n\n[Q]: https://github.com/kriskowal/q\n[Browserify]: https://github.com/substack/node-browserify\n[Mr]: https://github.com/kriskowal/mr\n[Montage]: https://github.com/montagejs/montage\n\nThis is how it looks:\n\n```javascript\nvar Q = require(\"q\");\nvar Connection = require(\"q-comm\");\nvar remote = Connection(port, local);\n```\n\nThe ``remote`` object is a promise for the ``local`` object\non the other side of the connection.  Likewise, the other\nside of the connection will get a promise for your ``local``\nobject.  You are not obliged to provide a local object,\ndepending on which end of the connection is providing a\nservice.\n\nIf the ``remote`` or ``local`` object is not serializable,\nlike functions or objects with methods, the other side will\nreceive a promise but you will have to “send messages” to\nthe promise instead of interacting directly with the remote\nobject.  When you invoke a method on a remote object, you\nget a promise for the result and you can immediately\npipeline a method call on the result.  This is the secret\nsauce.\n\nThe ``port`` is any W3C message port, web worker, or web\nsocket.  In the W3C’s infinite wisdom, these do not have a\nunified API, but Q-Comm will normalize them internally.\n\n```javascript\n// To communicate with objects in a worker\nvar worker = new Worker(\"worker.js\");\nvar child = Connection(worker, local);\n```\n\n```javascript\n// Inside a worker, to communicate with the parent\nvar parent = Connection(this);\n```\n\n```javascript\n// To communicate with a remote object on the other side of\n// a web socket\nvar socket = new WebSocket(\"ws://example.com\");\nvar remote = Connection(socket, local);\n```\n\n```javascript\n// To communicate with a single frame on the same origin\n// (multiple frames will require some handshaking event sources)\nvar iframe = document.frames[0];\nvar child = Connection(iframe.contentWindow, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// To communicate with a parent frame on the same origin\nvar child = Connection(window, local, {\n    origin: window.location.origin\n})\n```\n\n```javascript\n// With a message port\nvar port = new MessagePort();\nvar near = Connection(port[0]);\nvar far = Connection(port[1]);\n```\n\nYour ``local`` value can be any JavaScript value, but it is\nmost handy for it to be an object that supports an API and\ncannot be serialized with JSON.\n\n```javascript\nvar Q = require(\"q\");\nvar counter = 0;\nvar local = {\n    \"next\": function () {\n        return counter++;\n    }\n};\n```\n\nIn this case, the local object has a \"next\" function that\nreturns incremental values.  Since the function closes on\nlocal state (the ``counter``), it can't be sent to another\nprocess.\n\nOn the other side of the connection, we can asynchronously\ncall the remote method and receive a promise for the result.\n\n```javascript\nremote.invoke(\"next\")\n.then(function (id) {\n    console.log(\"counter at\", i);\n});\n```\n\nThe connection is bi-directional.  Although you do not need\nto provide and use both ``local`` and ``remote`` values on\nboth sides of a connection, they are available.\n\nYou can asynchronously interact with any value using the Q\nAPI.  This chart shows the analogous operations for\ninteracting with objects synchronously and asynchronously.\n\n```\nsynchronous                asynchronous\n------------------         -------------------------------\nvalue.foo                  promise.get(\"foo\")\nvalue.foo = value          promise.put(\"foo\", value)\ndelete value.foo           promise.del(\"foo\")\nvalue.foo(...args)         promise.post(\"foo\", [args])\nvalue.foo(...args)         promise.invoke(\"foo\", ...args)\nvalue(...args)             promise.fapply([args])\nvalue(...args)             promise.fcall(...args)\n```\n\nAll of the asynchronous functions return promises for the\neventual result.  For the asynchronous functions, the value\nmay be any value including local values, local promises, and\nremote promises.\n\nThe benefit to using the asynchronous API when interacting\nwith remote objects is that you can send chains of messages\nto the promises that the connection makes.  That is, you can\ncall the method of a promise that has not yet been resolved,\nso that message can be immediately sent over the wire to the\nremote object.  This reduces the latency of interaction with\nremote objects by removing network round-trips.\n\nA chain of dependent operations can be contracted from:\n\n```\n<-client     server->\na..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nb..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\nc..\n   ''--..\n         ''--..\n               ''--..\n             ..--''\n       ..--''\n ..--''\n```\n\nDown to:\n\n```\n<-client     server->\na..\nb..''--..\nc..''--..''--..\n   ''--..''--..''--..\n         ''--..--''..\n       ..--''..--''..\n ..--''..--''..--''\n ..--''..--''\n ..--''\n```\n\nWhere the dotted lines represent messages traveling through\nthe network horizontally, and through time vertically.\n\n\nPorts\n-----\n\nQ-Comm handles a variety of message ports or channel types.  They are\nall internally converted into a Q Channel.  If you are using a message\nchannel that provides a different API than this or a WebWorker,\nWebSocket, or MessagePort, you can adapt it to any of these interfaces\nand Q-Comm will handle it.\n\nThis is probably the simplest way to create a channel duck-type,\nassuming that you’ve got a connection instance of the Node variety.\n\n```javascript\nvar port = {\n    postMessage: function (message) {\n        connection.send(message);\n    },\n    onmessage: null // gets filled in by Q-Comm\n};\nconnection.on(\"message\", function (data) {\n    port.onmessage({data: \"\"})\n});\nvar remote = Connection(port, local);\n```\n\n## Q Channels\n\n-   ``get()`` returns a promise for the next message from the other\n    side of the connection.  ``get`` may be called any number of times\n    independent of when messages are actually received and each call\n    will get a promise for the next message in sequence.\n-   ``put(message)`` sends a message to the remote side of the\n    connection.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    sent.\n-   ``closed`` a promise that is fulfilled with the reason for closing.\n\nQ-Comm exports an indefinite ``Queue`` that supports this API which\ngreatly simplifies the implementation of adapters.\n\n-   ``get()`` returns a promise for the next value in order that is\n    put on the queue.  ``get`` may be called any number of times,\n    regardless of whether the corresponding value is put on the queue\n    before or after the ``get`` call.\n-   ``put(value)`` puts a message on the queue.  Any number of\n    messages can be put on the queue, indepent of whether and when the\n    corresponding ``get`` is called.\n-   ``close(reason_opt)`` indicates that no further messages will be\n    put on the queue and that any promises for such messages must be\n    rejected with the given reason.\n-   ``closed`` a promise that is fulfilled when and if the queue has\n    been closed.\n\n## Web Workers and Message Ports\n\nQ-Comm detects ports by their ``postMessage`` function.\n\n-   ``postMessage(message)``\n-   ``onmessage(handler(message))``\n\n## Web Sockets\n\nQ-Comm detects Web Sockets by their ``send`` function.  It takes the\nliberty to start the socket and listens for when it opens.\n\n-   ``send(message)``\n-   ``addEventListener(event, handler(event))``\n-   ``start()``\n-   ``open`` event\n-   ``close`` event\n\nMemory\n------\n\nQ-Comm uses an LRU cache of specified size.  The default size is\ninfinite, which is horribly leaky.  Promises between peers will stick\naround indefinitely.  This can be trimmed to something reasonable with\nthe ``max`` option.\n\n```javascript\nvar remote = Connection(port, local, {max: 1024});\n```\n\nThe least frequently used promises will be collected.  If the remote\nattempts to communicate with a collected promise, the request will be\nrejected.  This is fine if you have code in place to recover from\nrejections that will revive the working set of promises.  The minimum\nworking set will vary depending on the load on your service.\n\n","_id":"q-comm@0.4.2","dist":{"shasum":"f33de85676f3c5993b5aea32ab1a493b94cf8362","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.4.2.tgz","integrity":"sha512-OWknrsys9ilTpwk3Wj3ybx9r+jzfjUajnGDkKE/iXr4aA+ewLuGFRzTubgBOdJawfSUBnleatXowLryRsLC+mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzsrW/RNJ1P6IfmWdru4zhne3BIWOTA7S5Rymi4Z3SwAiAcuQIe3C0WcjXUOt4Mi1FE7WUSJ7J2aZpykV03Rg71Qw=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]},"0.5.0":{"name":"q-comm","version":"0.5.0","description":"Q-Comm has been renamed Q-Connection","homepage":"http://github.com/kriskowal/q-connection/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"readme":"\nThis project has been renamed [Q-Connection][].\n\n[Q-Connection]: https://github.com/kriskowal/q-connection\n\n","_id":"q-comm@0.5.0","dist":{"shasum":"d05511570b9519535b86b2453d7bb7829b3ec64b","tarball":"https://registry.npmjs.org/q-comm/-/q-comm-0.5.0.tgz","integrity":"sha512-5ksowlQDuWnAFYCzKh9ezPK7smbxLxmF8Tn5SRzSJw4IPT7zjoRieicY1DWxirGyihi897Esjn219wODSvmFvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICxO7EjX/OL/2aIdB2epa14aVBOpqY/BMIjQ7ZI/W4jiAiAz7jaRtuhawZCuhSbe3eHk3LkYgmjjolFi4jKav4cdsw=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}]}},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}],"time":{"modified":"2022-06-25T03:18:28.869Z","created":"2011-01-04T20:13:56.924Z","0.0.0":"2011-01-04T20:13:57.733Z","0.0.1":"2011-01-05T18:09:46.782Z","0.0.2":"2011-01-05T18:12:27.538Z","0.0.3":"2011-01-05T18:19:03.307Z","0.1.0":"2011-01-05T19:26:25.212Z","0.1.1":"2011-01-11T23:11:15.679Z","0.1.2":"2011-01-19T03:27:44.319Z","0.2.0":"2011-05-18T23:46:24.832Z","0.3.0":"2012-01-12T00:38:23.801Z","0.3.1":"2012-01-12T23:38:18.776Z","0.4.0":"2012-10-20T01:18:20.649Z","0.4.1":"2012-10-31T20:03:28.068Z","0.4.2":"2012-11-07T23:33:25.569Z","0.5.0":"2012-11-25T20:31:58.831Z"},"author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"repository":{"type":"git","url":"git://github.com/kriskowal/q-comm.git"}}