git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 3d251f593ad3a3a4e9b46eaf068ca9dc8ec39bfa

Files: 3d251f593ad3a3a4e9b46eaf068ca9dc8ec39bfa / pollMessage.js

438 bytesRaw
1const Message = require('./')
2module.exports = class PollMessage extends Message {
3 constructor (threshold) {
4 super()
5 this.threshold = threshold
6 this.promise = new Promise((resolve, reject) => {
7 this._resolve = resolve
8 })
9 }
10
11 get isSystem () {
12 return true
13 }
14
15 get isPoll () {
16 return true
17 }
18
19 response () {
20 return this.promise
21 }
22
23 respond (tickPromise) {
24 this._resolve(tickPromise)
25 }
26}
27

Built with git-ssb-web