lazy-socket

0.0.4 • Public • Published

lazy-socket

Build Status

A stateless socket that always lets you write().

If there is an error, all previous write() callbacks will be honored. A new connection will be established as soon as the next write() occurs. Writes will not be retried.

Install

npm install lazy-socket

Usage

var LazySocket = require('lazy-socket');
var socket = LazySocket.createConnection(80, 'example.org');
socket.write('something', 'utf-8', function(err) {
  // Even if example.org is down, this callback is guaranteed to fire, and
  // there is no more error handling to do on your end.
});

License

This module is licensed under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    195
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    195
  • 0.0.3
    5,224
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i lazy-socket

Weekly Downloads

4,948

Version

0.0.4

License

none

Last publish

Collaborators

  • felixge
  • tobyattagman