mirror of
https://github.com/hanzomsg/nats.js.git
synced 2026-10-30 20:31:36 +00:00
* [FIX] fixed lack of back-pressure on ordered pull consumer which bloated process memory * removed duplicated state from consumer object changed state copy to bump to the next sequence of the last message seen * addressed corner case where the consumer disappears from the time getConsumer() resolves to when the consumer is used * fmt * removed orderedpullconsumerimpl Signed-off-by: Alberto Ricart <[email protected]>
18 lines
507 B
TypeScript
18 lines
507 B
TypeScript
import { connect } from "test_helpers";
|
|
import { jetstream } from "../src/mod.ts";
|
|
|
|
const nc = await connect();
|
|
const js = jetstream(nc);
|
|
// const jsm = await jetstreamManager(nc);
|
|
// await jsm.consumers.add("stream", {name: "test", ack_policy: AckPolicy.Explicit});
|
|
// const c = await js.consumers.get("stream", "test");
|
|
const c = await js.consumers.get("stream");
|
|
|
|
const iter = await c.consume({ max_messages: 100 });
|
|
for await (const m of iter) {
|
|
console.log(m.seq);
|
|
// m.ack();
|
|
}
|
|
|
|
await nc.close();
|