Files: e8496bb49a74c164d39ddf569e49b73296bebe78 / 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