Files: 16503279a2722f474cd5b0d92906f32e9da38577 / port.js
307 bytesRaw
1 | module.exports = class Port { |
2 | constructor (name) { |
3 | this.name = name |
4 | this._queue = [] |
5 | this.ticks = 0 |
6 | } |
7 | |
8 | queue (message) { |
9 | this.ticks = message._fromPortTicks |
10 | this._queue.push(message) |
11 | } |
12 | |
13 | peek () { |
14 | return this._queue[0] |
15 | } |
16 | |
17 | shift () { |
18 | return this._queue.shift() |
19 | } |
20 | } |
21 |
Built with git-ssb-web