Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var _ = require( 'lodash' );
var when = require( 'when' );
var pipeline = require( 'when/pipeline' );
var postal = require( 'postal' );
var dispatch = postal.channel( 'rabbit.dispatch' );
var responses = postal.channel( 'rabbit.responses' );
var StatusList = require( './statusList.js' );
var machina = require( 'machina' )( _ );
var Monologue = require( 'monologue.js' )( _ );
var log = require( './log.js' );
var Channel = function( options, connection, topology ) {
var aliasOptions = function( options, aliases ) {
var aliased = _.transform( options, function( result, value, key ) {
var alias = aliases[ key ];
result[ alias || key ] = value;
} );
return _.omit( aliased, Array.prototype.slice.call( arguments, 2 ) );
};
var _ = require( 'lodash' );
var when = require( 'when' );
var pipeline = require( 'when/pipeline' );
var postal = require( 'postal' );
var dispatch = postal.channel( 'rabbit.dispatch' );
var responses = postal.channel( 'rabbit.responses' );
var StatusList = require( './statusList.js' );
var machina = require( 'machina' )( _ );
var Monologue = require( 'monologue.js' )( _ );
var log = require( './log.js' );
var Channel = function( options, connection, topology ) {
var aliasOptions = function( options, aliases ) {
var aliased = _.transform( options, function( result, value, key ) {
var alias = aliases[ key ];
result[ alias || key ] = value;
} );
return _.omit( aliased, Array.prototype.slice.call( arguments, 2 ) );
};
var Fsm = machina.Fsm.extend( {
var _ = require( 'lodash' );
var when = require( 'when' );
var pipeline = require( 'when/pipeline' );
var postal = require( 'postal' );
var dispatch = postal.channel( 'rabbit.dispatch' );
var responses = postal.channel( 'rabbit.responses' );
var StatusList = require( './statusList.js' );
var machina = require( 'machina' )( _ );
var Monologue = require( 'monologue.js' )( _ );
var log = require( './log.js' );
var Channel = function( options, connection, topology ) {
var aliasOptions = function( options, aliases ) {
var aliased = _.transform( options, function( result, value, key ) {
var alias = aliases[ key ];
result[ alias || key ] = value;
} );
return _.omit( aliased, Array.prototype.slice.call( arguments, 2 ) );
};
'use strict';
var postal = require('postal');
var channel = postal.channel();
var frnhtToCelcius = require('../utilities/frnht-to-celcius');
module.exports = function() {
var tempEl = document.querySelector('[data-ref=temperature]').querySelector('[data-ref=value]');
var cCoverEl = document.querySelector('[data-ref=cloudCover]').querySelector('[data-ref=value]');
var aPressureEl = document.querySelector('[data-ref=airPressure]').querySelector('[data-ref=value]');
function ConditionValues(locationData) {
this.temperature = frnhtToCelcius(locationData.temperature.value);
//this.temperature = (locationData.temperature.value - 32) * 5/9;
this.cloudCover = locationData.cloudCover.value * 100;
this.airPressure = locationData.pressure.value;
}
channel.subscribe('userUpdate', function(locationData) {
var conditionValues = new ConditionValues(locationData);
retryFunctions: [],
unlockRetryFunctions: function() {
_.each(this.retryFunctions, function(fun) {
fun();
});
this.lockRetryAttempt = false;
this.retryFunctions = [];
},
addRetryFunction: function(fun) {
this.retryFunctions.push(fun);
}
};
var monster = {
_channel: postal.channel('monster'),
_fileExists: function(url, success, error) {
$.ajax({
url: url,
type: 'HEAD',
error: function(status) {
error && error();
},
success: function(status) {
success && success();
}
});
},
_requests: {},
require('../setup.js');
var postal = require('postal');
var signal = postal.channel('rabbit.ack');
var AckBatch = require('../../src/ackBatch.js');
var noOp = function () {};
describe('Ack Batching', function () {
describe('when adding a new message', function () {
var batch;
var messageData;
before(function () {
batch = new AckBatch('test-queue', 'test-connection', noOp);
messageData = batch.getMessageOps(101);
batch.addMessage(messageData);
});
function remap (list) {
return list.map((item) => ({ status: item.status, tag: item.tag }));
}
var moment = require('moment');
var postal = require('postal');
var config = require('../config');
var db = require('./db')(config);
var transport = require('./transport');
var logger = require('./utils/logger');
var bus = postal.channel('action:execute');
var subscribers = [];
var handler = function (action, set, message, callback) {
db.actions.findAndModify({
query: {_id: action._id},
update: {$set: set},
'new': true
}, function (err, action) {
logger.info(message + ' ' + action.id);
callback && callback(err, action);
});
};
var executor = {
success: function (action, callback) {
handler(action, {state: 'executed', executed: moment().utc().toDate()}, 'action executed', callback);
var postal = require('postal');
var pace = 0,
loop = null,
paceChannel = postal.channel('fitbuddy', 'pace'),
paceIncreaseChannel = postal.channel('fitbuddy', 'pace.increase'),
paceDecreaseChannel = postal.channel('fitbuddy', 'pace.decrease'),
elevationChangeChannel = postal.channel('fitbuddy', 'elevation.change');
var run = function () {
paceChannel.publish({currentPace: pace});
};
elevationChangeChannel.subscribe(function (data) {
var paceChange = -(data.delta / 2);
module.exports.change(paceChange);
});
module.exports = {
accel: function (increment, callback) {
setTimeout(function () {
if (increment === 0) {
var postal = require('postal'),
random = require('./random');
var changeChannel = postal.channel('fitbuddy', 'elevation.change');
var currentElevation = 465; //avg. St. Louis
var changeElevation = function () {
var delta = random(-5, +5);
currentElevation += delta;
changeChannel.publish({
delta: delta,
elevation: currentElevation,
increased: function () {
return delta > 0;
},
decreased: function () {
return delta < 0;
},
toString: function () {
_notify_viewer_loaded(viewer) {
let channel = postal.channel();
channel.publish(
'viewer_loaded',
{
element: viewer.identifier
}
);
}
}