forked from muka/peerjs-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
queue.go
34 lines (29 loc) · 780 Bytes
/
queue.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package peer
// NewEncodingQueue initializes an EncodingQueue
// func NewEncodingQueue() *EncodingQueue {
// return &EncodingQueue{
// Emitter: NewEmitter(),
// Queue: [][]byte{},
// }
// }
// //EncodingQueue encoding queue
// type EncodingQueue struct {
// Emitter
// Processing bool
// Queue [][]byte
// }
// // Destroy destroys the queue instance
// func (e *EncodingQueue) Destroy() {
// e.Processing = false
// e.Queue = [][]byte{}
// }
// // Size return the queue size
// func (e *EncodingQueue) Size() int {
// return len(e.Queue)
// }
// // Enque add element to the queue
// func (e *EncodingQueue) Enque(raw []byte) {
// // e.queue = append(e.queue, raw)
// // TODO understand if conversion to ArrayBuffer is needed
// e.Emit("done", raw)
// }