{"_id":"matchmaker","_rev":"11-b93dffeabbe04ea2fe14b8483a644111","name":"matchmaker","description":"policy free matchmaking to pair objects","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"author":{"name":"David Wee","email":"rook2pawn@gmail.com","url":"http://rook2pawn.com"},"name":"matchmaker","description":"streaming, policy free matchmaking to pair objects using per-object preference functions","version":"0.0.1","homepage":"https://github.com/rook2pawn/node-matchmaker","repository":{"type":"git","url":"git://github.com/rook2pawn/node-matchmaker.git"},"main":"index.js","dependencies":{"queuelib":">= 0.0.6"},"devDependencies":{},"_npmJsonOpts":{"file":"/home/rook/.npm/matchmaker/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"matchmaker@0.0.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"0140b1dc678031b621015e1dae74abd65994c1c0","tarball":"https://registry.npmjs.org/matchmaker/-/matchmaker-0.0.1.tgz","integrity":"sha512-CWXAePhIEsigW5/U8l5XbW7tL0yRaMuXTlp8fi1IDdojIr0y97IG7nYzprYcLxPh9ReZHy0tTGeXACUQcbhFCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1DckJgp43N99+45HLMS3Y8egwrYX8QBswwUOcDJC8EQIgSgb7+c9EHd3MVfON38//HTsvOyfG30mjY0adqcvNyts="}]},"scripts":{},"directories":{}},"0.1.0":{"author":{"name":"David Wee","email":"rook2pawn@gmail.com","url":"http://rook2pawn.com"},"name":"matchmaker","description":"policy free matchmaking to pair objects","version":"0.1.0","homepage":"https://github.com/rook2pawn/node-matchmaker","repository":{"type":"git","url":"git://github.com/rook2pawn/node-matchmaker.git"},"main":"index.js","devDependencies":{},"readme":"matchmaker\n==========\n\nmatchmaker is a VERY simple, perhaps, simplistic matchmaker that creates two-element match sets.\n\nTo create a match you need a policy function that takes two elements\nand returns an integer value. If the integer value is higher than some\nthreshold, it is considered a match and emits 'match'.\n\n\nSay we want to match people by some rank. we could do the following:\n\n    var Matchmaker = require('matchmaker');\n    var mymatch = new Matchmaker;\n    mymatch.policy = function(a,b) {\n        if (Math.abs(a.rank-b.rank) < 20)\n            return 100\n        else \n            return 0\n    };\n    mymatch.on('match', function(result) {\n        console.log(result.a); // match a\n        console.log(result.b); // match b\n    });\n    mymatch.start();\n\nThen we can \n    \n    mymatch.push({user:'walter',rank:1450});\n    mymatch.push({user:'skyler',rank:1465});\n\nProperties\n==========\n\n.policy\n-------\nYou can set\n   \n    mymatch.policy = function(a,b) {\n        // do some comparisons...\n        // your logic\n        // if it satisfies\n           // return 100 (or threshold)\n        // else\n        // return 0 (or below threshold)\n    }\n\n.prefs\n------\nYou can set\n    \n    mymatch.prefs.checkinterval = 5000; // default\n    mymatch.prefs.threshold = 100; // default\n    mymatch.prefs.maxiters = 5; // default\n\n.prefs.checkinterval is the number of milliseconds between insepcting the queue with the policy function\n\n.prefs.threshold is the integer that is compared with the policy function output\n\n.prefs.maxiters is the maximum number of iterations to process the entire queue between checkintervals.\n\n.queue\n------\nThis is the internal queue for storing elements to be matched.\n\nMETHODS\n=======\n\n.push\n-----\n.push allows you to push elements into the queue.\n\n.start\n------\n.start starts the service.\n\n.stop\n-----\n.stop stops the service.\n\n\nLICENSE\n=======\n\nnode-matchmaker Copyright (c) 2011 David Wee rook2pawn@gmail.com\n\nFree software provided under the MIT License\nhttp://opensource.org/licenses/mit-license.php\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/rook2pawn/node-matchmaker/issues"},"_id":"matchmaker@0.1.0","dist":{"shasum":"9a90495698e87c08ca97daa2354e036f708a7e9f","tarball":"https://registry.npmjs.org/matchmaker/-/matchmaker-0.1.0.tgz","integrity":"sha512-oq4VIZPH2ohAeFRNgmgSFO7+Oy9CwBHcPwERLoe+pGhNuidAnRuSCu3Qf8F9vyGLtzj5qXUId5p2gD2QKcbjZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2ZGRnpVJx3ELWr3SrMwV0FC/gXyxF1z8xr4Y98immXAiEAgyZsFO9qZ5pZaXWWiDuz//1VEBrt1OyWhynPuXks1T0="}]},"_from":"node-matchmaker","_npmVersion":"1.2.30","_npmUser":{"name":"rook2pawn","email":"rook2pawn@gmail.com"},"maintainers":[{"name":"rook2pawn","email":"rook2pawn@gmail.com"}]}},"maintainers":[{"name":"rook2pawn","email":"rook2pawn@gmail.com"}],"time":{"modified":"2022-06-19T16:31:05.944Z","created":"2011-07-25T00:46:04.118Z","0.0.1":"2011-07-25T00:46:06.168Z","0.1.0":"2013-08-22T10:55:25.344Z"},"author":{"name":"David Wee","email":"rook2pawn@gmail.com","url":"http://rook2pawn.com"},"repository":{"type":"git","url":"git://github.com/rook2pawn/node-matchmaker.git"}}