项目作者: loguntsov

项目描述 :
Tracking of banned objects without storing these objects in memory.
高级语言: Erlang
项目地址: git://github.com/loguntsov/ban_system.git
创建时间: 2018-02-27T14:27:49Z
项目社区:https://github.com/loguntsov/ban_system

开源协议:MIT License

下载


BAN-SYSTEM

Application for ban of something by time.
It doesn’t keep real data about blocked objects.
It just uses Bloom filters to decide is object blocked or not.
So there is can be collissions for objects.

USAGE

Start of instance:

  1. ban_system:start(blocked_objects, 50000, 5).

Where:

  • 50000 - timeout of blocking
  • 5 - count of attempts, after object will be blocked.

Block of object:

  1. ban_system:block(blocked_objects, [ object_1 ]).

Is object blocked?

  1. ban_system:is_blocked(blocked_objects, object_1).

Add attempts for object:

  1. ban_system:add_attempt(blocked_objects, [ object_1 ]).

If attempts are more than 5 then object will be blocked:

  1. ban_system:attempts(blocked_objects, [ object_1 ]) =:= [{ object_1, blocked}]

After 50000 ms object will be deblocked.

More use cases in bs_test.erl file

Links

Based on https://github.com/basho/ebloom

License

MIT