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

Add silent-retry support for factory messages + support for factories without async-trait #275

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

slawlor
Copy link
Owner

@slawlor slawlor commented Oct 16, 2024

This pull request adds a few things.

  1. I'm enabling a lot more warning messages on the core ractor crate in order to maintain a higher code quality. This induced a lot of needlessly pub functions to be marked as pub(crate) since the visibility was controlled by the parent struct anyways. Additionally a lot of Debug implementations are added for publicly exported types.
  2. This adds a new type called RetriableMessage which when used in conjunction with a Factory allows us to automatically retry a message should it be dropped due to a factory worker failing (or panicking). Tests added on this functionality.
  3. Lastly as requested in Dont gate factory behind async-trait #272 and With async-trait turned off, it is impossible to use factory #248, with the stabilization of async traits natively, factories were gated behind the async-trait feature since we utilized dyn Trait with async methods, which is not natively supported. For those specific traits (DynamicDiscardController, FactoryLifecycleHooks, and WorkerCapacityController) I've migrated them to BoxFuture<'_, TOutput> in order to ungate factory usage with native async traits. This is thankfully possible due to the large factory rewrite that occurred in Improvements to the factory construct #237 which greatly improved the factory ergnomics.

Resolves #272

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 67.91809% with 94 lines in your changes missing coverage. Please review.

Project coverage is 80.20%. Comparing base (9a9a938) to head (88d2dea).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ractor/src/factory/factoryimpl.rs 0.00% 29 Missing ⚠️
ractor/src/factory/job.rs 84.31% 16 Missing ⚠️
ractor/src/factory/discard.rs 0.00% 14 Missing ⚠️
ractor/src/factory/worker.rs 0.00% 9 Missing ⚠️
ractor/src/factory/queues.rs 0.00% 6 Missing ⚠️
ractor/src/actor/mod.rs 0.00% 5 Missing ⚠️
ractor/src/message.rs 0.00% 5 Missing ⚠️
ractor/src/factory/tests/worker_lifecycle.rs 94.93% 4 Missing ⚠️
ractor/src/actor/messages.rs 0.00% 3 Missing ⚠️
ractor/src/port/output/mod.rs 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
- Coverage   80.60%   80.20%   -0.40%     
==========================================
  Files          60       60              
  Lines       10405    10671     +266     
==========================================
+ Hits         8387     8559     +172     
- Misses       2018     2112      +94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slawlor slawlor force-pushed the silent_night branch 3 times, most recently from c5a4ead to 5d8979b Compare October 16, 2024 14:33
…er dies, the message can be silently retried up to a number of retries, without the caller being notified or having the message dropped.

Also: Add debug implementations everywhere and more build deny rules
@slawlor slawlor changed the title Adds a silent-retry support for factory messages Adds a silent-retry support for factory messages + support for factories without async-trait Oct 16, 2024
@slawlor slawlor changed the title Adds a silent-retry support for factory messages + support for factories without async-trait Add silent-retry support for factory messages + support for factories without async-trait Oct 16, 2024
@slawlor slawlor marked this pull request as ready for review October 16, 2024 15:26
@slawlor slawlor merged commit defec7f into main Oct 16, 2024
11 of 13 checks passed
@slawlor slawlor deleted the silent_night branch October 16, 2024 15:27
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.

Dont gate factory behind async-trait
1 participant