Software /
code /
prosody
Annotate
teal-src/util/queue.d.tl @ 12828:f33887f925e1
net.server_epoll: Remove delay on last main loop iteration when quitting
Main difference is that timers are not checked unconditionally before
each poll, only when running out of previous poll results (hidden by
util.poll). This removes a final poll at shutdown that usually delays
the 'not quitting' condition check by one second.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 06 Jan 2023 04:38:39 +0100 |
parent | 12622:ef59fb975d3e |
rev | line source |
---|---|
12622
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local record lib |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 record queue<T> |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 size : integer |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 count : function (queue<T>) : integer |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 enum push_errors |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 "queue full" |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 end |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 push : function (queue<T>, T) : boolean, push_errors |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 pop : function (queue<T>) : T |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 peek : function (queue<T>) : T |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 replace : function (queue<T>, T) : boolean, push_errors |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 type iterator = function (T, integer) : integer, T |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 items : function (queue<T>) : iterator, T, integer |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 type consume_iter = function (queue<T>) : T |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 consume : function (queue<T>) : consume_iter |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 end |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 new : function<T> (size:integer, allow_wrapping:boolean) : queue<T> |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 end |
ef59fb975d3e
util.queue: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 return lib; |