@imqueue/core 3.2.5 → 3.3.0

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/src/IMQMode.js CHANGED
@@ -19,10 +19,34 @@
19
19
  * purchase a proprietary commercial license. Please contact us at
20
20
  * <support@imqueue.com> to get commercial licensing options.
21
21
  */
22
+ /**
23
+ * Operating mode of a queue instance, selecting which halves of the queue are
24
+ * active. Passed as the third constructor argument and defaults to
25
+ * {@link IMQMode.BOTH}.
26
+ *
27
+ * All modes still open a writer connection and take part in watcher election;
28
+ * the mode only controls whether a reader is created and whether sending is
29
+ * allowed.
30
+ *
31
+ * @remarks
32
+ * The members carry implicit numeric values and `BOTH` is `0`, so a falsy check
33
+ * such as `mode || IMQMode.WORKER` silently resolves to `WORKER`. Do not
34
+ * persist these values either — they shift if the members are reordered.
35
+ */
22
36
  export var IMQMode;
23
37
  (function (IMQMode) {
38
+ /**
39
+ * Consume and produce. This is the default.
40
+ */
24
41
  IMQMode[IMQMode["BOTH"] = 0] = "BOTH";
42
+ /**
43
+ * Consume only. No messages can be sent — `send()` throws a `TypeError`.
44
+ */
25
45
  IMQMode[IMQMode["WORKER"] = 1] = "WORKER";
46
+ /**
47
+ * Produce only. No reader connection is opened, so the queue never emits
48
+ * `message` events and never releases delayed messages.
49
+ */
26
50
  IMQMode[IMQMode["PUBLISHER"] = 2] = "PUBLISHER";
27
51
  })(IMQMode || (IMQMode = {}));
28
52
  //# sourceMappingURL=IMQMode.js.map