-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from nats-io/term-reason
[FEAT] added `reason` to JsMsg#term - this feature requires 2.11.0
- Loading branch information
Showing
4 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ import { Js409Errors } from "../jsutil.ts"; | |
import { nuid } from "../../nats-base-client/nuid.ts"; | ||
import { deferred } from "../../nats-base-client/util.ts"; | ||
import { assertExists } from "https://deno.land/[email protected]/assert/assert_exists.ts"; | ||
import { consume } from "./jetstream_test.ts"; | ||
import { consume } from "./jstest_util.ts"; | ||
|
||
Deno.test("jetstream - fetch expires waits", async () => { | ||
const { ns, nc } = await setup(jetstreamServerConf({}, true)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,32 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
import { AckPolicy, nanos, PubAck, StreamConfig } from "../../src/mod.ts"; | ||
import { | ||
AckPolicy, | ||
JsMsg, | ||
nanos, | ||
PubAck, | ||
QueuedIterator, | ||
StreamConfig, | ||
} from "../../src/mod.ts"; | ||
import { assert } from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { | ||
Empty, | ||
NatsConnection, | ||
nuid, | ||
} from "../../nats-base-client/internal_mod.ts"; | ||
|
||
export async function consume(iter: QueuedIterator<JsMsg>): Promise<JsMsg[]> { | ||
const buf: JsMsg[] = []; | ||
await (async () => { | ||
for await (const m of iter) { | ||
m.ack(); | ||
buf.push(m); | ||
} | ||
})(); | ||
return buf; | ||
} | ||
|
||
export async function initStream( | ||
nc: NatsConnection, | ||
stream: string = nuid.next(), | ||
|