Skip to content

Commit

Permalink
[DOC] updated readme
Browse files Browse the repository at this point in the history
[BENCH] updated bench to use `noAsyncTraces`
  • Loading branch information
aricart committed Oct 26, 2023
1 parent b95a8bb commit 0a30d76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ all functionality starts with a connection.

To connect to a server you use the `connect()` function. It returns a connection
that you can use to interact with the server. You can customize the behavior of
the client by specifying many [`ConnectionOptions`](#Connection_Options).
the client by specifying many [`ConnectionOptions`](#connection-options).

By default, a connection will attempt a connection on `127.0.0.1:4222`. If the
connection is dropped, the client will attempt to reconnect. You can customize
Expand Down Expand Up @@ -608,7 +608,7 @@ You can specify several options when creating a subscription:

- `max`: maximum number of messages to receive - auto unsubscribe
- `timeout`: how long to wait for the first message
- `queue`: the [queue group](#Queue-Groups) name the subscriber belongs to
- `queue`: the [queue group](#queue-groups) name the subscriber belongs to
- `callback`: a function with the signature
`(err: NatsError|null, msg: Msg) => void;` that should be used for handling
the message. Subscriptions with callbacks are NOT iterators.
Expand Down Expand Up @@ -780,15 +780,17 @@ The following is the list of connection options and default values.
| `authenticator` | none | Specifies the authenticator function that sets the client credentials. |
| `debug` | `false` | If `true`, the client prints protocol interactions to the console. Useful for debugging. |
| `ignoreClusterUpdates` | `false` | If `true` the client will ignore any cluster updates provided by the server. |
| `ignoreAuthErrorAbort` | `false` | Prevents client connection aborts if the client fails more than twice in a row with an authentication error |
| `inboxPrefix` | `"_INBOX"` | Sets de prefix for automatically created inboxes - `createInbox(prefix)` |
| `maxPingOut` | `2` | Max number of pings the client will allow unanswered before raising a stale connection error. |
| `maxReconnectAttempts` | `10` | Sets the maximum number of reconnect attempts. The value of `-1` specifies no limit. |
| `name` | | Optional client name - recommended to be set to a unique client name. |
| `noAsyncTraces` | `false` | When `true` the client will not add additional context to errors associated with request operations. Setting this option to `true` will improve greatly improve performance of request/reply and JetStream publishers. |
| `noEcho` | `false` | Subscriptions receive messages published by the client. Requires server support (1.2.0). If set to true, and the server does not support the feature, an error with code `NO_ECHO_NOT_SUPPORTED` is emitted, and the connection is aborted. Note that it is possible for this error to be emitted on reconnect when the server reconnects to a server that does not support the feature. |
| `noRandomize` | `false` | If set, the order of user-specified servers is randomized. |
| `pass` | | Sets the password for a connection. |
| `pedantic` | `false` | Turns on strict subject format checks. |
| `pingInterval` | `120000` | Number of milliseconds between client-sent pings. |
| `pingInterval` | `120000` | Number of milliseconds between client-s<br/>ent pings. |
| `port` | `4222` | Port to connect to (only used if `servers` is not specified). |
| `reconnect` | `true` | If false, client will not attempt reconnecting. |
| `reconnectDelayHandler` | Generated function | A function that returns the number of millis to wait before the next connection to a server it connected to `()=>number`. |
Expand Down
6 changes: 5 additions & 1 deletion examples/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ const pendingLimit = parseInt(argv.pendingLimit) * 1024;
const metrics = [];

for (let i = 0; i < iters; i++) {
const nc = await connect({ servers: server, debug: argv.debug });
const nc = await connect({
servers: server,
debug: argv.debug,
noAsyncTraces: true,
});
const opts = {
msgs: count,
size: bytes,
Expand Down

0 comments on commit 0a30d76

Please sign in to comment.