Skip to content

Commit 329a9fa

Browse files
committed
paperwork
1 parent 1b1247f commit 329a9fa

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
!**/*.bib
1515
!**/*.ps
1616
!**/*.cls
17+
!**/*.json
1718
/site
1819
style.c
1920

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
language: c
3+
compiler: gcc
4+
dist: trusty
5+
sudo: required
6+
install: make distclean
7+
script: make test

API.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Lawn API
2+
3+
## Lawn Auditing
4+
`Lawn* newLawn(void);`
5+
6+
Create a new Lawn timer store.
7+
8+
9+
`void freeLawn(Lawn* dehy);`
10+
11+
Free all data and memory of a Lawn data store
12+
13+
14+
`size_t ttl_count(Lawn* dehy);`
15+
16+
Return the number of uniqe ttl entries in the lawn
17+
18+
19+
`mstime_t next_at(Lawn* dehy);`
20+
21+
Return the closest element expiration datetime (in milliseconds), or -1 if DS is empty
22+
23+
24+
## TTL Manipulation
25+
26+
`int set_element_ttl(Lawn* dehy, char* element, size_t len, mstime_t ttl_ms);`
27+
28+
Insert ttl for a new element or update an existing one. Returns DHY_OK on success, DHY_ERR on error.
29+
30+
`mstime_t get_element_exp(Lawn* dehy, char* element);`
31+
32+
Get the expiration value for the given element. Returns datetime of expiration (in milliseconds) on success, -1 on error
33+
34+
35+
`int del_element_exp(Lawn* dehy, char* element);`
36+
37+
Remove TTL from the lawn for the given element. Returns `DHY_OK`
38+
39+
40+
`char* pop_next(Lawn* dehy);`
41+
42+
Remove and return the element with the closest expiration datetime
43+
44+
45+
`ElementQueue* pop_expired(Lawn* dehy);`
46+
47+
return a queue of all exired element nodes.
48+
49+
50+
## QUEUE UTILITIES
51+
52+
53+
54+
55+
56+
57+
58+
`void freeQueue(ElementQueue* queue);`
59+
60+
Free all data and memory of a queue retuned from the `pop_expired` method.
61+
62+
63+
`void queuePush(ElementQueue* queue, ElementQueueNode* node);`
64+
65+
Add a given `ElementQueueNode` to a queue retuned from the `pop_expired` method.
66+
67+
68+
`ElementQueueNode* queuePop(ElementQueue* queue);`
69+
70+
Remove and return the first `ElementQueueNode` from a queue retuned from the `pop_expired` method.
71+
72+
73+
## ELEMENT NODE UTILITIES
74+
75+
`ElementQueueNode* NewNode(char* element, size_t element_len, mstime_t ttl);`
76+
77+
Create an `ElementQueueNode`.
78+
79+
`void freeNode(ElementQueueNode* node);`
80+
81+
Free all data and memory of an `ElementQueueNode`.

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "lawn",
3+
"version": "0.0.1",
4+
"repo": "picotera/lawn",
5+
"description": "Unbound Low Latancy Timer Data-Structure for Large Scale Systems",
6+
"keywords": ["lawn", "timer", "ttl", "stream", "stream-proccessing", "timer-wheel", "real-time"],
7+
"license": "Apache2",
8+
"src": ["src/lawn.c", "src/lawn.h"]
9+
}

0 commit comments

Comments
 (0)