This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from karait import Message, Queue | |
print 'Starting python writer.' | |
messages_written = 0 | |
start = time.time() | |
queue = Queue() | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'karait' | |
require 'yaml' | |
puts "Starting ruby reader/writer" | |
messages_read = 0.0 | |
start_time = Time.now().to_f | |
queue = Karait::Queue.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
sender: writer.py | |
messages_read_per_second: 1653.29212369982 | |
started_running: 1314790290.33488 | |
messages_written_per_second: 1900.18564215637 | |
messages_written: 106199 | |
messages_read: 110250.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.Queue = function(params, onQueueReady) { | |
if (typeof(params) === 'function') { | |
onQueueReady = params; | |
params = {}; | |
} | |
var defaults = { | |
host: 'localhost', | |
port: 27017, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection.prototype.insertAll = function insertAll (docs, options, callback) { | |
if('function' === typeof options) callback = options, options = {}; | |
if(options == null) options = {}; | |
if(!('function' === typeof callback)) callback = null; | |
// ... Function body. | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res.sendfile = function(path, options, fn){ | |
var self = this | |
, req = self.req | |
, next = this.req.next | |
, options = options || {}; | |
// support function as second arg | |
if ('function' == typeof options) { | |
fn = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.jQueryify = exports.jsdom.jQueryify = function (window /* path [optional], callback */) { | |
var args = Array.prototype.slice.call(arguments), | |
callback = (typeof(args[args.length - 1]) === 'function') && args.pop(), | |
path, | |
jQueryTag = window.document.createElement("script"); | |
if (args.length > 1 && typeof(args[1] === 'string')) { | |
path = args[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.jQueryify = exports.jsdom.jQueryify = function (window /* path [optional], callback */) { | |
var args = Array.prototype.slice.call(arguments), | |
callback = (typeof(args[args.length - 1]) === 'function') && args.pop(), | |
path, | |
jQueryTag = window.document.createElement("script"); | |
if (args.length > 1 && typeof(args[1] === 'string')) { | |
path = args[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.func = function(options, callback) { | |
if (typeof(options) === 'function') { | |
callback = options; | |
options = {}; | |
} | |
callback = callback || function() {}; | |
// ... Function body. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.func = function(options, callback) { | |
sexy.args([this], function() { | |
// ... Function body. | |
}); | |
} |