Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Expose internal state of the PRNG from Random #4817

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Mar 20, 2024

In the context of #4063, we need to have an access onto the internal state of the PRNG backing the instance of Random in order to be able to serialize it and recreate the "exact" same instance of Random on destination (another worker thread).

The current PR adds a getState method on Random.

Adding it should be enough to fulfill the needs of #4063. But we will wait for it to be confirmed before releasing any minor version including that change.

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

In the context of #4063, we need to have an access onto the internal state of the PRNG backing the instance of `Random` in order to be able to serialize it and recreate the "exact" same instance of `Random` on destination (another worker thread).

The current PR adds a `getState` method on `Random`.

Adding it should be enough to fulfill the needs of #4063. But we will wait for it to be confirmed before releasing any minor version including that change.
Copy link

codesandbox-ci bot commented Mar 20, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c6a263e:

Sandbox Source
@fast-check/examples Configuration

@dubzzz dubzzz enabled auto-merge (squash) March 20, 2024 21:50
Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fb5b800b30e03757e7d12b--dubzzz-fast-check.netlify.app

@dubzzz dubzzz merged commit 74a9d3a into main Mar 20, 2024
50 checks passed
@dubzzz dubzzz deleted the get-state-from-random branch March 20, 2024 21:57
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