mongodb-livedata-server 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/livedata_server.d.ts +4 -4
- package/dist/livedata_server.js +11 -11
- package/dist/meteor/binary-heap/max_heap.d.ts +31 -31
- package/dist/meteor/binary-heap/max_heap.js +186 -186
- package/dist/meteor/binary-heap/min_heap.d.ts +6 -6
- package/dist/meteor/binary-heap/min_heap.js +17 -17
- package/dist/meteor/binary-heap/min_max_heap.d.ts +11 -11
- package/dist/meteor/binary-heap/min_max_heap.js +48 -48
- package/dist/meteor/callback-hook/hook.d.ts +11 -11
- package/dist/meteor/callback-hook/hook.js +78 -78
- package/dist/meteor/ddp/crossbar.d.ts +15 -15
- package/dist/meteor/ddp/crossbar.js +136 -136
- package/dist/meteor/ddp/heartbeat.d.ts +19 -19
- package/dist/meteor/ddp/heartbeat.js +77 -77
- package/dist/meteor/ddp/livedata_server.d.ts +141 -142
- package/dist/meteor/ddp/livedata_server.js +403 -403
- package/dist/meteor/ddp/method-invocation.d.ts +35 -35
- package/dist/meteor/ddp/method-invocation.js +72 -72
- package/dist/meteor/ddp/random-stream.d.ts +8 -8
- package/dist/meteor/ddp/random-stream.js +100 -100
- package/dist/meteor/ddp/session-collection-view.d.ts +20 -20
- package/dist/meteor/ddp/session-collection-view.js +106 -106
- package/dist/meteor/ddp/session-document-view.d.ts +8 -8
- package/dist/meteor/ddp/session-document-view.js +82 -82
- package/dist/meteor/ddp/session.d.ts +75 -75
- package/dist/meteor/ddp/session.js +590 -590
- package/dist/meteor/ddp/stream_server.d.ts +20 -21
- package/dist/meteor/ddp/stream_server.js +181 -181
- package/dist/meteor/ddp/subscription.d.ts +94 -94
- package/dist/meteor/ddp/subscription.js +370 -370
- package/dist/meteor/ddp/utils.d.ts +8 -8
- package/dist/meteor/ddp/utils.js +104 -104
- package/dist/meteor/ddp/writefence.d.ts +20 -20
- package/dist/meteor/ddp/writefence.js +111 -111
- package/dist/meteor/diff-sequence/diff.d.ts +17 -17
- package/dist/meteor/diff-sequence/diff.js +257 -257
- package/dist/meteor/ejson/ejson.d.ts +82 -82
- package/dist/meteor/ejson/ejson.js +568 -569
- package/dist/meteor/ejson/stringify.d.ts +2 -2
- package/dist/meteor/ejson/stringify.js +119 -119
- package/dist/meteor/ejson/utils.d.ts +12 -12
- package/dist/meteor/ejson/utils.js +42 -42
- package/dist/meteor/mongo/caching_change_observer.d.ts +16 -16
- package/dist/meteor/mongo/caching_change_observer.js +63 -63
- package/dist/meteor/mongo/doc_fetcher.d.ts +7 -7
- package/dist/meteor/mongo/doc_fetcher.js +53 -53
- package/dist/meteor/mongo/geojson_utils.d.ts +3 -3
- package/dist/meteor/mongo/geojson_utils.js +40 -41
- package/dist/meteor/mongo/live_connection.d.ts +28 -28
- package/dist/meteor/mongo/live_connection.js +264 -264
- package/dist/meteor/mongo/live_cursor.d.ts +25 -25
- package/dist/meteor/mongo/live_cursor.js +60 -60
- package/dist/meteor/mongo/minimongo_common.d.ts +84 -84
- package/dist/meteor/mongo/minimongo_common.js +1998 -1998
- package/dist/meteor/mongo/minimongo_matcher.d.ts +23 -23
- package/dist/meteor/mongo/minimongo_matcher.js +283 -283
- package/dist/meteor/mongo/minimongo_sorter.d.ts +16 -16
- package/dist/meteor/mongo/minimongo_sorter.js +268 -268
- package/dist/meteor/mongo/observe_driver_utils.d.ts +9 -9
- package/dist/meteor/mongo/observe_driver_utils.js +72 -73
- package/dist/meteor/mongo/observe_multiplexer.d.ts +46 -46
- package/dist/meteor/mongo/observe_multiplexer.js +203 -203
- package/dist/meteor/mongo/oplog-observe-driver.d.ts +68 -68
- package/dist/meteor/mongo/oplog-observe-driver.js +918 -918
- package/dist/meteor/mongo/oplog_tailing.d.ts +35 -35
- package/dist/meteor/mongo/oplog_tailing.js +352 -352
- package/dist/meteor/mongo/oplog_v2_converter.d.ts +1 -1
- package/dist/meteor/mongo/oplog_v2_converter.js +125 -126
- package/dist/meteor/mongo/polling_observe_driver.d.ts +30 -30
- package/dist/meteor/mongo/polling_observe_driver.js +216 -221
- package/dist/meteor/mongo/synchronous-cursor.d.ts +17 -17
- package/dist/meteor/mongo/synchronous-cursor.js +261 -261
- package/dist/meteor/mongo/synchronous-queue.d.ts +13 -13
- package/dist/meteor/mongo/synchronous-queue.js +110 -110
- package/dist/meteor/ordered-dict/ordered_dict.d.ts +31 -31
- package/dist/meteor/ordered-dict/ordered_dict.js +198 -198
- package/dist/meteor/random/AbstractRandomGenerator.d.ts +42 -42
- package/dist/meteor/random/AbstractRandomGenerator.js +92 -92
- package/dist/meteor/random/AleaRandomGenerator.d.ts +13 -13
- package/dist/meteor/random/AleaRandomGenerator.js +90 -90
- package/dist/meteor/random/NodeRandomGenerator.d.ts +16 -16
- package/dist/meteor/random/NodeRandomGenerator.js +42 -42
- package/dist/meteor/random/createAleaGenerator.d.ts +2 -2
- package/dist/meteor/random/createAleaGenerator.js +32 -32
- package/dist/meteor/random/createRandom.d.ts +1 -1
- package/dist/meteor/random/createRandom.js +22 -22
- package/dist/meteor/random/main.d.ts +1 -1
- package/dist/meteor/random/main.js +12 -12
- package/dist/meteor/types.d.ts +1 -1
- package/dist/meteor/types.js +2 -2
- package/package.json +5 -5
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports._SynchronousQueue = void 0;
|
|
7
|
-
const double_ended_queue_1 = __importDefault(require("double-ended-queue"));
|
|
8
|
-
class _SynchronousQueue {
|
|
9
|
-
constructor() {
|
|
10
|
-
// List of tasks to run (not including a currently-running task if any). Each
|
|
11
|
-
// is an object with field 'task' (the task function to run) and 'future' (the
|
|
12
|
-
// Future associated with the blocking runTask call that queued it, or null if
|
|
13
|
-
// called from queueTask).
|
|
14
|
-
this._taskHandles = new double_ended_queue_1.default();
|
|
15
|
-
// This is true if self._run() is either currently executing or scheduled to
|
|
16
|
-
// do so soon.
|
|
17
|
-
this._runningOrRunScheduled = false;
|
|
18
|
-
// This is true if we're currently draining. While we're draining, a further
|
|
19
|
-
// drain is a noop, to prevent infinite loops. "drain" is a heuristic type
|
|
20
|
-
// operation, that has a meaning like unto "what a naive person would expect
|
|
21
|
-
// when modifying a table from an observe"
|
|
22
|
-
this._draining = false;
|
|
23
|
-
}
|
|
24
|
-
async runTask(task) {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var handle = {
|
|
27
|
-
task: task,
|
|
28
|
-
name: task.name,
|
|
29
|
-
runTaskResolve: resolve,
|
|
30
|
-
runTaskReject: reject
|
|
31
|
-
};
|
|
32
|
-
this._taskHandles.push(handle);
|
|
33
|
-
this._scheduleRun();
|
|
34
|
-
// Yield. We'll get back here after the task is run (and will throw if the
|
|
35
|
-
// task throws).
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
queueTask(task) {
|
|
39
|
-
var self = this;
|
|
40
|
-
self._taskHandles.push({
|
|
41
|
-
task: task,
|
|
42
|
-
name: task.name
|
|
43
|
-
});
|
|
44
|
-
self._scheduleRun();
|
|
45
|
-
// No need to block.
|
|
46
|
-
}
|
|
47
|
-
async flush() {
|
|
48
|
-
var self = this;
|
|
49
|
-
await self.runTask(async () => { });
|
|
50
|
-
}
|
|
51
|
-
async drain() {
|
|
52
|
-
var self = this;
|
|
53
|
-
if (self._draining)
|
|
54
|
-
return;
|
|
55
|
-
self._draining = true;
|
|
56
|
-
while (!self._taskHandles.isEmpty()) {
|
|
57
|
-
await self.flush();
|
|
58
|
-
}
|
|
59
|
-
self._draining = false;
|
|
60
|
-
}
|
|
61
|
-
;
|
|
62
|
-
_scheduleRun() {
|
|
63
|
-
// Already running or scheduled? Do nothing.
|
|
64
|
-
if (this._runningOrRunScheduled)
|
|
65
|
-
return;
|
|
66
|
-
this._runningOrRunScheduled = true;
|
|
67
|
-
setImmediate(async () => {
|
|
68
|
-
await this._run();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
;
|
|
72
|
-
async _run() {
|
|
73
|
-
var self = this;
|
|
74
|
-
if (!self._runningOrRunScheduled)
|
|
75
|
-
throw new Error("expected to be _runningOrRunScheduled");
|
|
76
|
-
if (self._taskHandles.isEmpty()) {
|
|
77
|
-
// Done running tasks! Don't immediately schedule another run, but
|
|
78
|
-
// allow future tasks to do so.
|
|
79
|
-
self._runningOrRunScheduled = false;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
var taskHandle = self._taskHandles.shift();
|
|
83
|
-
// Run the task.
|
|
84
|
-
var exception = undefined;
|
|
85
|
-
try {
|
|
86
|
-
await taskHandle.task();
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
if (taskHandle.runTaskReject) {
|
|
90
|
-
// We'll throw this exception through runTask.
|
|
91
|
-
exception = err;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
console.error("Exception in queued task", err);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// Soon, run the next task, if there is any.
|
|
98
|
-
self._runningOrRunScheduled = false;
|
|
99
|
-
self._scheduleRun();
|
|
100
|
-
// If this was queued with runTask, let the runTask call return (throwing if
|
|
101
|
-
// the task threw).
|
|
102
|
-
if (taskHandle.runTaskReject) {
|
|
103
|
-
if (exception)
|
|
104
|
-
taskHandle.runTaskReject(exception);
|
|
105
|
-
else
|
|
106
|
-
taskHandle.runTaskResolve();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports._SynchronousQueue = _SynchronousQueue;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports._SynchronousQueue = void 0;
|
|
7
|
+
const double_ended_queue_1 = __importDefault(require("double-ended-queue"));
|
|
8
|
+
class _SynchronousQueue {
|
|
9
|
+
constructor() {
|
|
10
|
+
// List of tasks to run (not including a currently-running task if any). Each
|
|
11
|
+
// is an object with field 'task' (the task function to run) and 'future' (the
|
|
12
|
+
// Future associated with the blocking runTask call that queued it, or null if
|
|
13
|
+
// called from queueTask).
|
|
14
|
+
this._taskHandles = new double_ended_queue_1.default();
|
|
15
|
+
// This is true if self._run() is either currently executing or scheduled to
|
|
16
|
+
// do so soon.
|
|
17
|
+
this._runningOrRunScheduled = false;
|
|
18
|
+
// This is true if we're currently draining. While we're draining, a further
|
|
19
|
+
// drain is a noop, to prevent infinite loops. "drain" is a heuristic type
|
|
20
|
+
// operation, that has a meaning like unto "what a naive person would expect
|
|
21
|
+
// when modifying a table from an observe"
|
|
22
|
+
this._draining = false;
|
|
23
|
+
}
|
|
24
|
+
async runTask(task) {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var handle = {
|
|
27
|
+
task: task,
|
|
28
|
+
name: task.name,
|
|
29
|
+
runTaskResolve: resolve,
|
|
30
|
+
runTaskReject: reject
|
|
31
|
+
};
|
|
32
|
+
this._taskHandles.push(handle);
|
|
33
|
+
this._scheduleRun();
|
|
34
|
+
// Yield. We'll get back here after the task is run (and will throw if the
|
|
35
|
+
// task throws).
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
queueTask(task) {
|
|
39
|
+
var self = this;
|
|
40
|
+
self._taskHandles.push({
|
|
41
|
+
task: task,
|
|
42
|
+
name: task.name
|
|
43
|
+
});
|
|
44
|
+
self._scheduleRun();
|
|
45
|
+
// No need to block.
|
|
46
|
+
}
|
|
47
|
+
async flush() {
|
|
48
|
+
var self = this;
|
|
49
|
+
await self.runTask(async () => { });
|
|
50
|
+
}
|
|
51
|
+
async drain() {
|
|
52
|
+
var self = this;
|
|
53
|
+
if (self._draining)
|
|
54
|
+
return;
|
|
55
|
+
self._draining = true;
|
|
56
|
+
while (!self._taskHandles.isEmpty()) {
|
|
57
|
+
await self.flush();
|
|
58
|
+
}
|
|
59
|
+
self._draining = false;
|
|
60
|
+
}
|
|
61
|
+
;
|
|
62
|
+
_scheduleRun() {
|
|
63
|
+
// Already running or scheduled? Do nothing.
|
|
64
|
+
if (this._runningOrRunScheduled)
|
|
65
|
+
return;
|
|
66
|
+
this._runningOrRunScheduled = true;
|
|
67
|
+
setImmediate(async () => {
|
|
68
|
+
await this._run();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
;
|
|
72
|
+
async _run() {
|
|
73
|
+
var self = this;
|
|
74
|
+
if (!self._runningOrRunScheduled)
|
|
75
|
+
throw new Error("expected to be _runningOrRunScheduled");
|
|
76
|
+
if (self._taskHandles.isEmpty()) {
|
|
77
|
+
// Done running tasks! Don't immediately schedule another run, but
|
|
78
|
+
// allow future tasks to do so.
|
|
79
|
+
self._runningOrRunScheduled = false;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
var taskHandle = self._taskHandles.shift();
|
|
83
|
+
// Run the task.
|
|
84
|
+
var exception = undefined;
|
|
85
|
+
try {
|
|
86
|
+
await taskHandle.task();
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (taskHandle.runTaskReject) {
|
|
90
|
+
// We'll throw this exception through runTask.
|
|
91
|
+
exception = err;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.error("Exception in queued task", err);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Soon, run the next task, if there is any.
|
|
98
|
+
self._runningOrRunScheduled = false;
|
|
99
|
+
self._scheduleRun();
|
|
100
|
+
// If this was queued with runTask, let the runTask call return (throwing if
|
|
101
|
+
// the task threw).
|
|
102
|
+
if (taskHandle.runTaskReject) {
|
|
103
|
+
if (exception)
|
|
104
|
+
taskHandle.runTaskReject(exception);
|
|
105
|
+
else
|
|
106
|
+
taskHandle.runTaskResolve();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports._SynchronousQueue = _SynchronousQueue;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export declare class OrderedDict {
|
|
2
|
-
static BREAK: {
|
|
3
|
-
break: boolean;
|
|
4
|
-
};
|
|
5
|
-
private _dict;
|
|
6
|
-
private _first;
|
|
7
|
-
private _last;
|
|
8
|
-
private _size;
|
|
9
|
-
private _stringify;
|
|
10
|
-
constructor(...args: any[]);
|
|
11
|
-
_k(key: any): string;
|
|
12
|
-
empty(): boolean;
|
|
13
|
-
get size(): number;
|
|
14
|
-
_linkEltIn(elt: any): void;
|
|
15
|
-
_linkEltOut(elt: any): void;
|
|
16
|
-
putBefore(key: any, item: any, before: any): void;
|
|
17
|
-
append(key: any, item: any): void;
|
|
18
|
-
delete(key: any): any;
|
|
19
|
-
get(key: any): any;
|
|
20
|
-
has(key: any): any;
|
|
21
|
-
forEach(iter: (doc: any, key: string, index: number) => any, context?: any): void;
|
|
22
|
-
first(): any;
|
|
23
|
-
firstValue(): any;
|
|
24
|
-
last(): any;
|
|
25
|
-
lastValue(): any;
|
|
26
|
-
prev(key: any): any;
|
|
27
|
-
next(key: any): any;
|
|
28
|
-
moveBefore(key: any, before: any): void;
|
|
29
|
-
indexOf(key: any): any;
|
|
30
|
-
_checkRep(): void;
|
|
31
|
-
}
|
|
1
|
+
export declare class OrderedDict {
|
|
2
|
+
static BREAK: {
|
|
3
|
+
break: boolean;
|
|
4
|
+
};
|
|
5
|
+
private _dict;
|
|
6
|
+
private _first;
|
|
7
|
+
private _last;
|
|
8
|
+
private _size;
|
|
9
|
+
private _stringify;
|
|
10
|
+
constructor(...args: any[]);
|
|
11
|
+
_k(key: any): string;
|
|
12
|
+
empty(): boolean;
|
|
13
|
+
get size(): number;
|
|
14
|
+
_linkEltIn(elt: any): void;
|
|
15
|
+
_linkEltOut(elt: any): void;
|
|
16
|
+
putBefore(key: any, item: any, before: any): void;
|
|
17
|
+
append(key: any, item: any): void;
|
|
18
|
+
delete(key: any): any;
|
|
19
|
+
get(key: any): any;
|
|
20
|
+
has(key: any): any;
|
|
21
|
+
forEach(iter: (doc: any, key: string, index: number) => any, context?: any): void;
|
|
22
|
+
first(): any;
|
|
23
|
+
firstValue(): any;
|
|
24
|
+
last(): any;
|
|
25
|
+
lastValue(): any;
|
|
26
|
+
prev(key: any): any;
|
|
27
|
+
next(key: any): any;
|
|
28
|
+
moveBefore(key: any, before: any): void;
|
|
29
|
+
indexOf(key: any): any;
|
|
30
|
+
_checkRep(): void;
|
|
31
|
+
}
|