JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13687
  • Score
    100M100P100Q139020F
  • License MIT

a link caching mechanism for the amqp10 module

Package Exports

  • amqp10-link-cache

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (amqp10-link-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

amqp10-link-cache

Build Status Dependency Status

This module allows you to reuse already created links with the same link options throughout your codebase. This is particularly useful as you no longer need to make all of the links up front before using them, you can simply always create the links where you need them and know that it will either be created or a cached copy will be returned.

usage

'use strict';
var LinkCache = require('../'),
    AMQPClient = require('amqp10').Client;

var client = new AMQPClient();
client.connect('amqp://localhost')
  .then(function() { return new LinkCache(client); });
  .then(function(cache) {
    // e.g. pass cache to all of your API endpoints _as_ the 'client'

    return Promise.all([ cache.crateSender('amq.topic'), cache.crateSender('amq.topic') ]);
  })
  .spread(function(sender1, sender2) {
    // sender1 === sender2
  });