_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
27
233k
language
stringclasses
1 value
meta_information
dict
q13200
train
function () { var message = this.message; var name = this.name; var url = this.url; var result = name; if (message) { result += ': ' +
javascript
{ "resource": "" }
q13201
train
function (err, files) { if (err) { grunt.fail.fatal(err); } files.forEach(function (file) { var pathName = path.join(workspacePath, file); if (fs.statSync(pathName).isDirectory()) { if (file === activeWebpackage && choices.length > 0) { choices.splice(0, 0...
javascript
{ "resource": "" }
q13202
EmitEvent
train
function EmitEvent(props) { const event = this; if ( !(event instanceof EmitEvent) ) { return new EmitEvent(props); } if ( props == undefined ) { props = '';
javascript
{ "resource": "" }
q13203
_extend
train
function _extend(obj, from) { for ( let key in from ) if ( hop.call(from, key) ) { obj[key]
javascript
{ "resource": "" }
q13204
_append
train
function _append(array, args/*, ...*/) { var i = array.length , j , k = 1 , l , m = arguments.length , a
javascript
{ "resource": "" }
q13205
train
function (data, circuitbreakerState, callback) { const responder = (circuitbreakerState===CB.OPEN) ? config.bypass : config.handler; // call the handler using its expected paradigm const promise = responder.length > 1 ? new Promise(function(resolve, reject) { respon...
javascript
{ "resource": "" }
q13206
serviceConfig
train
function serviceConfig() { var arg = ld.values(arguments), cfg = {}; // try to load file from global directory if(typeof arg[0] === 'string') { var path = arg.shift(); try { cfg = require('/etc/paukan/'+path+'.json'); } catch (err) { // try to load file directly if glob...
javascript
{ "resource": "" }
q13207
StreamConsole
train
function StreamConsole(cfg) { cfg = cfg || {}; this.color = cfg.color || true; this.timestamp = (typeof
javascript
{ "resource": "" }
q13208
InfiniteScrollSetup
train
function InfiniteScrollSetup (options) { options || (options = {}); var self = this; var gap = (options.gap || 20); // defaults to 20 self.events = self.events || {}; assign(self.events, {scroll: 'infiniteScroll'}); self.infiniteScroll = function () {
javascript
{ "resource": "" }
q13209
InfiniteScrollView
train
function InfiniteScrollView (options) { options || (options
javascript
{ "resource": "" }
q13210
hyperRepeat
train
function hyperRepeat(store) { this.compile = compile; this.state = function(config, state) { var res = store.get(config.path, state); if (!res.completed) return false; return state.set(config.source, res.value); }; this.children = function(config, state, children) { var items = state.get(confi...
javascript
{ "resource": "" }
q13211
compile
train
function compile(input) { var res = input.match(REGEX); if (!res) throw new Error('Invalid expression: "' + input + '"'); var range = res[3]; var parsedRange; if (range) { parsedRange = parser(range); if (parsedRange === null) throw new Error('Invalid range expression: "' + range + '" in "' + input +...
javascript
{ "resource": "" }
q13212
train
function(file, type) { var promise = new Parse.Promise(); if (typeof(FileReader) === "undefined") { return Parse.Promise.error(new Parse.Error( Parse.Error.FILE_READ_ERROR, "Attempted to use a FileReader on an unsupported browser.")); } var reader = new FileReader(); read...
javascript
{ "resource": "" }
q13213
train
function(options) { options= options || {}; var self = this; if (!self._previousSave) { self._previousSave = self._source.then(function(base64, type) { var data = { base64: base64, _ContentType: type }; return Parse._request({ ...
javascript
{ "resource": "" }
q13214
train
function (operation, parameter) { // TODO the reference to operation.api is not available if (operation.api
javascript
{ "resource": "" }
q13215
train
function (model, property) { // TODO the reference to model.api is not available if (model.api
javascript
{ "resource": "" }
q13216
baseIsEqual
train
function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { // Exit early for identical values. if (value === other) { // Treat `+0` vs. `-0` as not equal. return value !== 0 || (1 / value == 1 / other); } var valType = typeof value, othType = typeof other; // Exit early for unlik...
javascript
{ "resource": "" }
q13217
baseMatchesProperty
train
function baseMatchesProperty(key, value) { if (isStrictComparable(value)) { return function(object) { return object != null && object[key] === value && (typeof value != 'undefined' || (key in
javascript
{ "resource": "" }
q13218
createBaseEach
train
function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { var length = collection ? collection.length : 0; if (!isLength(length)) { return eachFunc(collection, iteratee); } var index = fromRight ? length : -1, iterable = toObject(collection); while ((fro...
javascript
{ "resource": "" }
q13219
train
function(config,callback,patsy){ patsy = typeof config === 'function' && typeof callback === 'object' ? callback : patsy; callback = typeof config === 'function' ? config : callback; config = typeof config === 'function' ? undefined : config; if(typeof config !== 'undefined' && type...
javascript
{ "resource": "" }
q13220
train
function(patsy, project_path){ if(opts.verbose){ util.print('>>'.cyan + ' Loading project configuration...'); } if(typeof project_path === 'undefined'){ if(opts.verbose){ patsy.utils.notice(); patsy.utils.notice('No project path set, declaring path to ...
javascript
{ "resource": "" }
q13221
train
function () { var defaultConfig = JSON.parse(fs.readFileSync(__dirname + '/../patsy.default.json', 'utf8')); var projectSpecificSettings = { "project": { "details" : { "name" : path.basename(process.cwd()) }, "environment": { "root" : path.basen...
javascript
{ "resource": "" }
q13222
dispatch
train
function dispatch(request, response) { return Promise.resolve() .then(resolveRouters.bind(this, request))
javascript
{ "resource": "" }
q13223
resolveRouters
train
function resolveRouters(request) { for (var i = 0, l = routers.length; i < l; i++) { var callback = routers[i].resolve(request); if (null != callback) {
javascript
{ "resource": "" }
q13224
callAction
train
function callAction(request, response, callback) { if (typeof callback == 'function') { return Promive.resolve() .then(callback.bind(null, request, response)); } try { var Action = require(ACTION_PATH + '/' + callback.action + '.js'); } catch (error) { if (error.message == 'Ca...
javascript
{ "resource": "" }
q13225
postDecode
train
function postDecode(request) { return new Promise(function promisePostDecode(resolve) { var postData = ''; if (request.method === 'POST') { request.on('data', function (chunk) { // append the current chunk of data to the fullBody variable postData += chunk.toString();
javascript
{ "resource": "" }
q13226
runHooks
train
function runHooks(request, response, hooks) { var promise = Promise.resolve(); for (var
javascript
{ "resource": "" }
q13227
pad
train
function pad(text, width) { var space = (width
javascript
{ "resource": "" }
q13228
generate
train
function generate() { var rnum = Math.floor(Math.random() * 10); var mood = rnum <= 8 ? "good" : "bad"; var sentences = [_sentence_mgr2.default.feeling(mood), _word_library2.default.warning(), nu.chooseFrom([_sentence_mgr2.default.relationship(mood), _sentence_mgr2.default.encounter(mood)])]; // rand...
javascript
{ "resource": "" }
q13229
FileListController
train
function FileListController($scope, mediator, $stateParams, $window, userClient, fileMediatorService, $timeout, mobileCamera, desktopCamera, FILE_CONFIG) { var self = this; self.files = null; var _files; self.uploadEnabled = FILE_CONFIG.uploadEnabled; userClient.getProfile().then(function(profileData){ va...
javascript
{ "resource": "" }
q13230
optionResult
train
function optionResult(options, option){ var result = options[option]; // If the returned value is a
javascript
{ "resource": "" }
q13231
build_shell
train
function build_shell(fields) { var $fields = Array.isArray(fields) ? normalizeFields(fields) : ['ProcessId','Name','Path','ParentProcessId','Priority']; var args = command.shell_arg.split(' ');
javascript
{ "resource": "" }
q13232
train
function(options) { options = extend({ src: '', output: '', is3d: false, failOnWarn: false, overwrite: false, reporter: 'default' }, options); if (!options.src || !options.output) { throw new Error('Must specify source file and output directory'); ...
javascript
{ "resource": "" }
q13233
handleRejects
train
function handleRejects(PromiseFunc, Obj, Err, Options){ var rejectOpts = Options.Reject || rejectConfig; switch(rejectOpts.rejectBehaviour){ case "reject": // Every time a promise finishes start the first one from the currentPromiseArrays[typeKey]Array that hasnt been started yet; ...
javascript
{ "resource": "" }
q13234
getHandler
train
function getHandler(method){ var taxonomy = { create: store.set, read: store.get, update: store.set, 'delete': store.remove,
javascript
{ "resource": "" }
q13235
valid_leader
train
function valid_leader(durations) { var on = durations[0]; var off = durations[1];
javascript
{ "resource": "" }
q13236
command_id_from_buffer
train
function command_id_from_buffer(data) { var durations = command_durations_from_hex_buffer(data); if (!valid_leader(durations)) return; var binary =
javascript
{ "resource": "" }
q13237
continue_from_buffer
train
function continue_from_buffer(data) { var durations = continue_durations_from_hex_buffer(data); var on = durations[0]; var off = durations[1]; var stop = durations[2];
javascript
{ "resource": "" }
q13238
versions
train
function versions(a, b) { if (!a || !b) return false; a = Array.isArray(a) ? a : Object.keys(a); b = Array.isArray(a)
javascript
{ "resource": "" }
q13239
dereference
train
function dereference(file, opts, cb) { parser.dereference(file.path, opts, (err, schema) => { if (err) { this.emit('error', new gutil.PluginError('gulp-jsonschema-deref', err, {fileName: file.path})); } else
javascript
{ "resource": "" }
q13240
breadcrumbs
train
function breadcrumbs(target, path) { path = pathToArray(path); const result = [target]; let part; let value = target; if (! isObject(value)) { return result; } for (let i = 0, l = path.length; i < l; i++) { part = path[i];
javascript
{ "resource": "" }
q13241
hasPath
train
function hasPath(target, path) { path = pathToArray(path); const result = breadcrumbs(target, path);
javascript
{ "resource": "" }
q13242
setByPath
train
function setByPath(target, path, value) { path = pathToArray(path); if (! path.length) { return value; } const key = path[0]; if (isNumber(key)) { if (! Array.isArray(target)) { target = []; } } else if (! isObject(target)) { target = {}; }
javascript
{ "resource": "" }
q13243
pushByPath
train
function pushByPath(target, path, value) { path = pathToArray(path); if (! path.length) { if (! Array.isArray(target)) { return [value]; } else { target.push(value); return target; } } if (! isObject(target)) { target = {}; } return at(target, path, function(finalTar...
javascript
{ "resource": "" }
q13244
getByPath
train
function getByPath(target, path) { path = pathToArray(path);
javascript
{ "resource": "" }
q13245
methodByPath
train
function methodByPath(target, path) { path = pathToArray(path); const values = breadcrumbs(target, path); if (values.length < path.length) { return noop;
javascript
{ "resource": "" }
q13246
callByPath
train
function callByPath(target, path, args) { var fn = methodByPath(target, path); if (! fn) {
javascript
{ "resource": "" }
q13247
train
function(point) { var d2r = Math.PI / 180.0; var lat1rad = this.latitude * d2r; var long1rad = this.longitude * d2r; var lat2rad = point.latitude * d2r; var long2rad = point.longitude * d2r; var deltaLat = lat1rad - lat2rad; var deltaLong = long1rad - long2rad; var sinDel...
javascript
{ "resource": "" }
q13248
throwError
train
function throwError(name, message) { var error = new Error(message); error.name = name; error.stack =
javascript
{ "resource": "" }
q13249
regret
train
function regret(name, input){ var matchers, res = null, re, matches, matcher; if(typeof name.exec === 'function'){ matchers = Object.keys(regret.matchers).filter(function(m){ return name.test(m); }).map(function(m){ return regret.matchers[m]; }); } else { matchers = regret.matchers[n...
javascript
{ "resource": "" }
q13250
seqActions
train
function seqActions(actions, seed, onCompleted) { var index = 0; function invokeNext(v) { var action = actions[index]; action(v, function
javascript
{ "resource": "" }
q13251
RestApi
train
function RestApi(config, cb) { var self = this; self.routes = {}; self.bindTo = (config && config.bindTo) ? config.bindTo : undefined; self.port = (config && config.port) ? config.port : DEFAULT_PORT; // create the HTTP server object and on every request, try to match the // request with a kno...
javascript
{ "resource": "" }
q13252
Rule
train
function Rule (subrules, type, handler, props, groupProps, encoding) { var self = this var n = subrules.length this.props = props this.debug = false // Used for cloning this.subrules = subrules // Required by Atok#_resolveRules for (var p in groupProps) this[p] = groupProps[p] // Runtime valu...
javascript
{ "resource": "" }
q13253
initializeItemSerializer
train
function initializeItemSerializer(hasItems) { // Is there is a itemSerializer specified, we MUST use it. // If existing data and no itemSerializer specified, this is an old JSON database, // so "fake"
javascript
{ "resource": "" }
q13254
_yield
train
function _yield(name, context) { var prop = this.props[name || 'children']; if (typeof prop !== 'function') return prop; var
javascript
{ "resource": "" }
q13255
getJsonResource
train
function getJsonResource(url) { var protocol = url.match(/^(.*?):/) protocol = (protocol && protocol[1]) || 'file' const defaultLoader = defaultOptions.loaders[protocol] const loader = options.loaders[protocol] return Promise.resolve(cache[url]) .then(cached => { if(cached) { re...
javascript
{ "resource": "" }
q13256
processNode
train
function processNode({rawNode, parsedNode, parentId = resourceId, cursor, refChain, prop}) { logger.info(`processNode ${cursor}${prop ? '(' + prop + ')' : ''} with refChain ${refChain}`) const currentId = options.urlBaseKey && rawNode[options.urlBaseKey] ? parseRef(rawNode[options.urlBaseKey], paren...
javascript
{ "resource": "" }
q13257
getAll
train
function getAll(name, deploy, fn, single) { getTree(name, deploy, function(err, tree) { if (err) return fn(err); var acc = []; flatten(tree, acc);
javascript
{ "resource": "" }
q13258
train
function(portKey) { var result = this.isValidPort(portKey)
javascript
{ "resource": "" }
q13259
train
function(ledName) { var result = this.isValidLEDName(ledName)
javascript
{ "resource": "" }
q13260
train
function(startState) { let dfa = new DFA(); let stateMap = {}; let epsilonNFASetCache = {}; // NFA-set -> NFA-set let startOrigin = { [startState]: 1 }; let start = this.epsilonClosure(startOrigin); epsilonNFASetCache[hashNFAStates(startOrigin)] = st...
javascript
{ "resource": "" }
q13261
virtualForm
train
function virtualForm (h, opts, arr) { if (!arr) { arr = opts opts = {} } assert.equal(typeof h, 'function') assert.equal(typeof opts, 'object') assert.ok(Array.isArray(arr), 'is array') return arr.map(function createInput (val) { if (typeof val === 'string') {
javascript
{ "resource": "" }
q13262
cleanRedundantCode
train
function cleanRedundantCode(str, opts){ opts = opts || {}; var minimize = def(opts.minimize, true); var comments = opts.comments || {}; var htmlComments = comments.html, rglComments = comments.rgl; if(minimize && typeof str === 'string'){ var SINGLE_SPACE = ' '; var EMPTY = ...
javascript
{ "resource": "" }
q13263
getCache
train
function getCache (pkg, config) { pkg = toPkg(pkg) if(config && config.cacheHash) return path.join(config.cache, pkg.shasum, 'package.tgz') return path.join(
javascript
{ "resource": "" }
q13264
get
train
function get (url, cb) { var urls = [], end _get(url, cb) function _get (url) { urls.push(url) if(end) return if(urls.length > 5) cb(end = new Error('too many redirects\n'+JSON.stringify(urls))) console.error('GET', url) ;(/^https/.test(url) ? https : http).get(url, function next (res) ...
javascript
{ "resource": "" }
q13265
getTarballStream
train
function getTarballStream (pkg, config, cb) { if(config.casDb && pkg.shasum) { var db = config.casDb db.has(pkg.shasum, function (err, stat) { if(!err) cb(null, db.getStream(pkg.shasum)) else //fallback to the old way... tryCache() }) } else
javascript
{ "resource": "" }
q13266
getTmp
train
function getTmp (config) { return path.join(config.tmpdir || '/tmp',
javascript
{ "resource": "" }
q13267
mixin
train
function mixin(source) { var keys = []; if (arguments.length > 1) { for (var i = 1, len = arguments.length; i < len; i++) { var key = arguments[i]; if (!source.hasOwnProperty(key)) { throw new Error(util.format('Property not found: %s', key)); } keys.push(key); } } else
javascript
{ "resource": "" }
q13268
subst
train
function subst(str, file, dst) { if (dst !== undefined) { str = str.replace(/\{\{DST\}\}/g, dst); } var dir = path.dirname(file); str = str.replace(/\{\{SRC\}\}/g, file); var name = path.basename(file); str = str.replace(/\{\{NAME\}...
javascript
{ "resource": "" }
q13269
train
function(request, response, next){ if (utils.Misc.isEmptyObject(request.query)) { var
javascript
{ "resource": "" }
q13270
train
function(request, response, next){ if (!utils.Misc.isNullOrUndefined(request.user)) { next(); } else { var error = new Error(errors['213']);
javascript
{ "resource": "" }
q13271
train
function(request, response, next){ if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) { next(); } else { var success = encodeURIComponent(request.protocol
javascript
{ "resource": "" }
q13272
train
function(request, response, next){ var apptkn; if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) { apptkn = request.get(X_BOLT_APP_TOKEN); } else { var error = new Error(errors['110']); response.end(utils.Misc.createResponse(null, error, 110)); return; } var name = __getAppFromA...
javascript
{ "resource": "" }
q13273
train
function(request, response, next){ var apptkn; if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) { apptkn = request.get(X_BOLT_APP_TOKEN); } else { var error = new Error(errors['110']); response.end(utils.Misc.createResponse(null, error, 110)); return; } var name = __getAppFromA...
javascript
{ "resource": "" }
q13274
train
function(request, response, next){ if (!utils.Misc.isNullOrUndefined(request.body.db)) { request.db = request.body.db; } else if (!utils.Misc.isNullOrUndefined(request.body.app)) { request.db = request.body.app; } else { var apptkn; if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN)))...
javascript
{ "resource": "" }
q13275
train
function(request, response, next) { var apptkn; if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) { apptkn = request.get(X_BOLT_APP_TOKEN); } else { var error = new Error(errors['110']); response.end(utils.Misc.createResponse(null, error, 110)); return; } var name = __getAppFrom...
javascript
{ "resource": "" }
q13276
toBitMask
train
function toBitMask(event) { if (!_.has(eventMap, event)) {
javascript
{ "resource": "" }
q13277
addFlags
train
function addFlags(mask, flags) { if (flags.onlydir) mask = mask | Inotify.IN_ONLYDIR; if (flags.dont_follow) mask = mask | Inotify.IN_DONT_FOLLOW;
javascript
{ "resource": "" }
q13278
FABridge__bridgeInitialized
train
function FABridge__bridgeInitialized(bridgeName) { var objects = document.getElementsByTagName("object"); var ol = objects.length; var activeObjects = []; if (ol > 0) { for (var i = 0; i < ol; i++) { if (typeof objects[i].SetVariable != "undefined") { activeObjects[activeObjects.length] ...
javascript
{ "resource": "" }
q13279
train
function(objRef, propName) { if (FABridge.refCount > 0) { throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround."); } else {
javascript
{ "resource": "" }
q13280
train
function(objRef,propName, value) { if (FABridge.refCount > 0) { throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround."); } else {
javascript
{ "resource": "" }
q13281
train
function(funcID, args) { if (FABridge.refCount > 0) { throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround."); } else {
javascript
{ "resource": "" }
q13282
train
function(objID, funcName, args) { if (FABridge.refCount > 0) { throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround."); } else { ...
javascript
{ "resource": "" }
q13283
train
function(funcID, args) { var result; var func = this.localFunctionCache[funcID];
javascript
{ "resource": "" }
q13284
train
function(objID, typeName) { var objType = this.getTypeFromName(typeName); instanceFactory.prototype = objType; var instance = new instanceFactory(objID);
javascript
{ "resource": "" }
q13285
train
function(typeData) { var newType = new ASProxy(this, typeData.name); var accessors = typeData.accessors; for (var i = 0; i < accessors.length; i++) { this.addPropertyToType(newType, accessors[i]);
javascript
{ "resource": "" }
q13286
train
function(ty, propName) { var c = propName.charAt(0); var setterName; var getterName; if(c >= "a" && c <= "z") { getterName = "get" + c.toUpperCase() + propName.substr(1); setterName = "set" + c.toUpperCase() + propName.substr(1); } ...
javascript
{ "resource": "" }
q13287
train
function(ty, methodName) { ty[methodName] = function() { return
javascript
{ "resource": "" }
q13288
train
function(funcID) { var bridge = this; if (this.remoteFunctionCache[funcID] == null) { this.remoteFunctionCache[funcID] = function()
javascript
{ "resource": "" }
q13289
train
function(func) { if (func.__bridge_id__ == undefined) { func.__bridge_id__ = this.makeID(this.nextLocalFuncID++);
javascript
{ "resource": "" }
q13290
shadowClose
train
function shadowClose(connection) { debug('shadowClose', 'start'); let close = connection.close; connection.close = function() { debug('connection.close','start'); //remove references delete promises[connection._mssqlngKey]; delete connections[connection._mssqlngKey]; //close original connect...
javascript
{ "resource": "" }
q13291
train
function (infos, name) { name = name || 'jsdoc.json'; var firstFile = null; var readme = null; var wp = new Parser(infos); var bufferFiles = function(file, enc, next){ if (file.isNull()) return; // ignore if (file.isStream()) return this.emit('error', new PluginError('gulp-j...
javascript
{ "resource": "" }
q13292
train
function(model, options) { if (!(model instanceof Parse.Object)) { var attrs = model; options.collection = this; model = new this.model(attrs, options); if (!model._validate(model.attributes, options)) {
javascript
{ "resource": "" }
q13293
_configGetExtLang
train
function _configGetExtLang(filext) { var fileext1 = filext.indexOf('.') == 0 ? fileext.substring(1, filext.length) : fileext;
javascript
{ "resource": "" }
q13294
extractCommentTagFromLine
train
function extractCommentTagFromLine(fileext, line) { line = line.trim(); // CHECK FORMAT [ var b; function chkfmt(b) { if (line.indexOf(b) == 0 && line.indexOf('[') == line.length-1) // begin return [line.substr(b.length, line.length-b.length-1).trim(), 0...
javascript
{ "resource": "" }
q13295
train
function(name, dimensions) { name = name || ''; name = name.replace(/^\s*/, ''); name = name.replace(/\s*$/, ''); if (name.length === 0) { throw 'A name for the custom event must be provided'; } _.each(dimensions, function(val, key) { if (!_.isString(key) || !_.isStr...
javascript
{ "resource": "" }
q13296
retryPromiseTimeout
train
function retryPromiseTimeout(PromiseFunc, Obj, Options){ let timeoutOpts = Options.Timeout; limitpromises = limitpromises || require('../limitpromises'); setTimeout( () => { if(Obj.isRunning && Obj.attempt <= timeoutOpts.retryAttempts){ // Put a new promise on the same stack as...
javascript
{ "resource": "" }
q13297
queue
train
function queue(task, done) { var storage = this, key = this.keygen(task); // store task as JSON serialized string task = JSON.stringify(task); // first add the key to the queue this.redis().rpush(this.queueKey(), key, function(err) { if (err) done(err); // now store task d...
javascript
{ "resource": "" }
q13298
unqueue
train
function unqueue(done) { var storage = this; this.redis().lpop(this.queueKey(), function(err, key) { if (err) return done(err); storage.redis().get(key, function(err, task)
javascript
{ "resource": "" }
q13299
log
train
function log(key, result, done) { var storage = this; // store result as JSON serialized string result = JSON.stringify(result); // generate result key from task key
javascript
{ "resource": "" }