git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 1083d2c0b8a6bbe729c7484eea2f03a5b54da970

Files: 1083d2c0b8a6bbe729c7484eea2f03a5b54da970 / 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