-
Notifications
You must be signed in to change notification settings - Fork 22
/
lua-lru-dev-1.rockspec
49 lines (42 loc) · 1.17 KB
/
lua-lru-dev-1.rockspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package = "lua-lru"
version = "dev-1"
source = {
url = "git://github.com/starius/lua-lru.git"
}
description = {
summary = "LRU cache in Lua",
license = "MIT",
homepage = "https://github.com/starius/lua-lru",
detailed = [[
lua-lru, LRU cache in Lua
LRU cache is implemented using a doubly linked list and
a hash map. Hash Map maps a key to a corresponding tuple.
Doubly Linked List is used to store list of tuples
(value, previous, next, key, size_in_bytes).
Key is needed in a tuple to be able to remove an element from
the hash map. Field size_in_bytes is optional and is used
if sizes in bytes are counted (and constrained) as well as
the number of elements.
Create an instance of LRU cache for 100 elements:
lru = require 'lru'
cache = lru.new(100)
Create an instance of LRU cache for 100 elements of
1000 bytes totally:
lru = require 'lru'
cache = lru.new(100, 1000)
Methods:
* cache:set(key, value, [size_in_bytes])
* cache:get(key)
* cache:delete(key)
* cache:pairs() or pairs(cache) for Lua >= 5.2
]],
}
dependencies = {
"lua >= 5.1",
}
build = {
type = "builtin",
modules = {
['lru'] = 'src/lru/lru.lua',
},
}