Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/logic/parametrized_select.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in commit message:
There was a but -> There was a bug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lead -> led

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function selectWithRows(number) {
utils.prepareDatabase(client, utils.tableSchemaBasic, next);
},
async function insert(next) {
utils.insertSimple(client, 10, next);
utils.insertSimple(client, number, next);
},
async function query(next) {
await utils.queryWithRowCheck(client, number, iterCnt, next);
Expand Down
5 changes: 5 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const { HostMap } = require("./host.js");
// eslint-disable-next-line no-unused-vars
const { QueryOptions } = require("./query-options.js");

// Initialize the direct-poll bridge once per process.
// This sets up the Tokio reactor thread and the wake mechanism used by all
// bridged async Rust functions (session queries, paging, etc.).
rust.initPollBridge();
Comment on lines +32 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ When is this executed? Is this guaranteed to be executed at most once? Is this idempotent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is this executed

When the file is first imported

Is this guaranteed to be executed at most once

Almost always yes: https://nodejs.org/docs/latest/api/modules.html#caching

Is this idempotent

No. The following calls will lead to a panic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this idempotent

Do you think it's worth making it idempotent, i.e. setting an atomic flag at the beginning of its execution that prevents double initialization?


/**
* Represents a database client that maintains multiple connections to the cluster nodes, providing methods to
* execute CQL statements.
Expand Down
Loading
Loading