git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: c5cdc89599c7a0c7c34af77912e1b919bf4cbf26

Files: c5cdc89599c7a0c7c34af77912e1b919bf4cbf26 / port.js

307 bytesRaw
1module.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