ttl-pool

1.0.1 • Public • Published

ttl-pool

a pool of expiring things

Installation

npm install ttl-pool

API

TTLPool(function onExpiry(name, explicit))

TTLPool(ttl, function onExpiry(name, explicit))

Returns a fresh TTL pool, with an optional default TTL.

ttlPool.add(id)

ttlPool.add(id, ttl)

Adds something to the pool.

ttlPool.ping(id)

ttlPool.ping(id, ttl)

Resets the TTL for something.

ttlpool.remove(id)

Removes something from the pool silently.

ttlPool.expire(id)

Expire something in the pool explicitly.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ttl-pool

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • nathan7