Module: caf_bloom/plug_bloom

A plug to access a Bloom filter backed by Redis.

Properties:

 {bitFieldName: string, service: string, size: number, slices: number}

where:

  • bitFieldName: is the array of the bitfield in Redis.
  • service: the local name of the Redis service, e.g., cp.
  • size: the number of bits.
  • slices: the number of hash functions.
Source:

Extends

Methods

add(key, cb)

Adds a key to the set.

Parameters:
Name Type Description
key string

The string key to add.

cb caf.cb

A callback to notify an error.

Source:

clear(cb)

Clears the filter.

Parameters:
Name Type Description
cb caf.cb

A callback to notify an error.

Source:

has(key, cb)

Checks that a key is in the set.

It uses a Bloom filter that can introduce false positives, but no false negatives.

Parameters:
Name Type Description
key string

The key to check.

cb caf.cb

A callback to return whether the key is in the set, or an error.

Source: