Files
Alberto RicartandGitHub cab0be08b2 [FIX] fixed lack of back-pressure on ordered pull consumer which bloated process memory (#67)
* [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]>
2024-10-03 15:02:07 -05:00

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();