-
Notifications
You must be signed in to change notification settings - Fork 51
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 #687 from nats-io/move-nanos
[CHANGE] moved `nanos()` and `millis()` to nats-base-client as they are referenced by the base library
- Loading branch information
Showing
27 changed files
with
72 additions
and
68 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
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
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
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
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 |
---|---|---|
|
@@ -28,8 +28,12 @@ import { | |
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { initStream } from "./jstest_util.ts"; | ||
import { AckPolicy, DeliverPolicy } from "../jsapi_types.ts"; | ||
import { deadline, deferred, delay } from "../../nats-base-client/util.ts"; | ||
import { nanos } from "../jsutil.ts"; | ||
import { | ||
deadline, | ||
deferred, | ||
delay, | ||
nanos, | ||
} from "../../nats-base-client/util.ts"; | ||
import { | ||
ConsumerEvents, | ||
ConsumerStatus, | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2022-2023 The NATS Authors | ||
* Copyright 2022-2024 The NATS Authors | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
|
@@ -19,13 +19,12 @@ import { | |
assertRejects, | ||
assertStringIncludes, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { deferred } from "../../nats-base-client/mod.ts"; | ||
import { deferred, nanos } from "../../nats-base-client/mod.ts"; | ||
import { | ||
AckPolicy, | ||
Consumer, | ||
ConsumerMessages, | ||
DeliverPolicy, | ||
nanos, | ||
PullOptions, | ||
} from "../mod.ts"; | ||
import { NatsServer } from "../../tests/helpers/launcher.ts"; | ||
|
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 |
---|---|---|
|
@@ -27,8 +27,7 @@ import { | |
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { Empty } from "../../nats-base-client/encoders.ts"; | ||
import { StringCodec } from "../../nats-base-client/codec.ts"; | ||
import { delay } from "../../nats-base-client/util.ts"; | ||
import { nanos } from "../jsutil.ts"; | ||
import { delay, nanos } from "../../nats-base-client/util.ts"; | ||
import { NatsConnectionImpl } from "../../nats-base-client/nats.ts"; | ||
import { syncIterator } from "../../nats-base-client/core.ts"; | ||
import { PullConsumerMessagesImpl } from "../consumer.ts"; | ||
|
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,15 +38,15 @@ import { | |
fail, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { Empty } from "../../nats-base-client/encoders.ts"; | ||
import { checkJsError, nanos } from "../jsutil.ts"; | ||
import { checkJsError } from "../jsutil.ts"; | ||
import { JSONCodec, StringCodec } from "../../nats-base-client/codec.ts"; | ||
import { | ||
consumerOpts, | ||
ConsumerOptsBuilderImpl, | ||
JetStreamSubscriptionInfoable, | ||
PubAck, | ||
} from "../types.ts"; | ||
import { deferred, delay } from "../../nats-base-client/util.ts"; | ||
import { deferred, delay, nanos } from "../../nats-base-client/util.ts"; | ||
import { | ||
DebugEvents, | ||
ErrorCode, | ||
|
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
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
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 |
---|---|---|
|
@@ -24,9 +24,8 @@ import { | |
assertEquals, | ||
assertRejects, | ||
} from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { nanos } from "../jsutil.ts"; | ||
import { NatsConnectionImpl } from "../../nats-base-client/nats.ts"; | ||
import { delay } from "../../nats-base-client/util.ts"; | ||
import { delay, nanos } from "../../nats-base-client/util.ts"; | ||
|
||
Deno.test("next - basics", async () => { | ||
const { ns, nc } = await setup(jetstreamServerConf()); | ||
|
@@ -161,6 +160,7 @@ Deno.test("next - deleted consumer", async () => { | |
const js = nc.jetstream(); | ||
const c = await js.consumers.get("A", "a"); | ||
|
||
(nc as NatsConnectionImpl).options.debug = true; | ||
const exited = assertRejects( | ||
() => { | ||
return c.next({ expires: 4000 }); | ||
|
@@ -191,7 +191,9 @@ Deno.test("next - stream not found", async () => { | |
const js = nc.jetstream(); | ||
const c = await js.consumers.get("A", "a"); | ||
|
||
(nc as NatsConnectionImpl).options.debug = true; | ||
await jsm.streams.delete("A"); | ||
await delay(1000); | ||
|
||
await assertRejects( | ||
() => { | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,8 @@ export { | |
deferred, | ||
delay, | ||
extend, | ||
millis, | ||
nanos, | ||
render, | ||
timeout, | ||
} from "./util.ts"; | ||
|
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
Oops, something went wrong.