File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 60
60
"err-code" : " ^1.1.2" ,
61
61
"length-prefixed-stream" : " ^1.6.0" ,
62
62
"protons" : " ^1.0.1" ,
63
- "pull-pushable" : " ^2.2.0"
63
+ "pull-pushable" : " ^2.2.0" ,
64
+ "time-cache" : " ^0.3.0"
64
65
},
65
66
"contributors" : [
66
67
" Vasco Santos <[email protected] >"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const EventEmitter = require('events')
4
4
const pull = require ( 'pull-stream/pull' )
5
5
const empty = require ( 'pull-stream/sources/empty' )
6
6
const asyncEach = require ( 'async/each' )
7
-
7
+ const TimeCache = require ( 'time-cache' )
8
8
const debug = require ( 'debug' )
9
9
const errcode = require ( 'err-code' )
10
10
@@ -31,6 +31,20 @@ class PubsubBaseProtocol extends EventEmitter {
31
31
this . multicodec = multicodec
32
32
this . libp2p = libp2p
33
33
this . started = false
34
+
35
+ /**
36
+ * Map of topics to which peers are subscribed to
37
+ *
38
+ * @type {Map<string, Peer> }
39
+ */
40
+ this . topics = new Map ( )
41
+
42
+ /**
43
+ * Cache of seen messages
44
+ *
45
+ * @type {TimeCache }
46
+ */
47
+ this . seenCache = new TimeCache ( )
34
48
35
49
/**
36
50
* Map of peers.
You can’t perform that action at this time.
0 commit comments