Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ft-poller

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ft-poller - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

examples/dedeplication/client.js

4

package.json
{
"name": "ft-poller",
"version": "0.0.3",
"version": "0.0.4",
"repository": {

@@ -10,3 +10,3 @@ "type": "git",

"description": "An http client to periodically fetch and cache data from web services",
"main": "./src/poller.js",
"main": "./src/server.js",
"directories": {

@@ -13,0 +13,0 @@ "lib": "./lib"

Scheduled, async content fetching for Node.js applications.
Scheduled, asynchronous JSON fetching for Node.js applications.

@@ -22,8 +22,8 @@ ### Background

Firstly, your response is dependent on the slowest service to respond. If every
request is hanging around waiting for 'the slow one' you are going only ever
going to perform at the slowest speed.
request is hanging around waiting for 'the slow one' your performance is pegged
to the worst performing part of your application.
Secondly, by far the slowest thing in this type of architecture is the
roundtrip between the presentation tier and the service(s). The more of these
you have hanging around, waiting for connections to close, the greater the
round-trip between the presentation tier and the service(s). The more of these
open connections you have hanging around, waiting to close, the greater the
burden you place on your server.

@@ -45,2 +45,6 @@

This pattern (of asynchronous fetching) allows the presentation tier to focus on
building a response from existing data (in memory) and sending it back out the
front door as quickly as possible.
### Usage

@@ -54,3 +58,3 @@

// Nb. do `npm install es6-promise` if running node < 10.x
// Nb. do `npm install es6-promise` if running node < 11.x
GLOBAL.Promise = require('es6-promise').Promise;

@@ -88,3 +92,3 @@

p.start({ initialRefresh: true });
p.start({ initialRequest: true });

@@ -91,0 +95,0 @@ ### Events

@@ -5,4 +5,2 @@ 'use strict';

var superPromise = require('superagent-promises');
var events = require('events');
var util = require('util');

@@ -16,4 +14,2 @@ var Poller = function(config) {

util.inherits(Poller, events.EventEmitter);
Poller.prototype.isRunning = function () {

@@ -20,0 +16,0 @@ return !!this.poller;

@@ -5,3 +5,3 @@

var chai = require('chai'),
Poller = require('../src/poller'),
Poller = require('../src/server'),
sinon = require('sinon'),

@@ -45,3 +45,3 @@ nock = require('nock'),

new Poller( {
var p = new Poller( {
url: 'http://example.com',

@@ -53,3 +53,5 @@ parseData: function (res) {

}
}).fetch();
})
p.fetch();
});

@@ -56,0 +58,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc