Skip to content

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 9, 2025

Description of Changes

This PR refactors various things in preparation for adding JS workers.
The changes are useful on their own without said workers and they are also their own PR for ease of review.

  1. Move all budget/timeout/energy/log-long-running logic to its own module.
  2. Extract some functions.
  3. Disable the separate thread that deals with timeouts, as it is currently triggering UB due to bugs in the v8 crate.x
  4. Look for __describe_module__ and __call_reducer__ first in the global object and then fallback to the module object. As per the changed design constraints for better UX (bundling and so on...).

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

Mostly covered by existing tests...
Also, future work.

@Centril Centril requested a review from coolreader18 October 9, 2025 17:27
@Centril Centril changed the base branch from centril/v8-modules to master October 9, 2025 20:42
…module.

This prefers the "global this" as it will become most common based on our chosen UX.
There is also a fallback added.

This also prepares for a js-worker thread
that will stay alive as long as the database does.
The aforementioned fallback will only be used on module startup
once the js-worker is used.
@Centril Centril force-pushed the centril/v8-js-worker-prepare branch from 68afdfd to 74db206 Compare October 9, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant