This project follows Rust semantic versioning.
- Fixups for Rust 1.78 warnings and clippy recommendations
Core::anymap_unset
to clear a stored anymap value
- MSRV changed to 1.63 from 1.60, because testing now requires const Mutex::new
Big testing refactor and rework:
- No longer depend on broken
RUST_TEST_THREADS=1
- No longer depend on previous script-based workaround
- Get rid of old
test-multi-thread
workaround - Under
cargo test
, when single-threaded testing is required, run a worker thread to force all tests to run on a single thread - However MIRI testing continues to use script-based workaround
Channel
to send messages to a Stakker thread from any other thread
- Test MSRV of 1.60
- Use Rust 2021 edition
- Replaced unmaintained
anymap
crate with simple safe inline implementation
LogLevel::try_from(u8)
plus derives: Hash, Ord, PartialOrd
- Fixed build failure when "no-unsafe-queue" feature was enabled alone
- Testing has been improved to catch any other similar issues
(maintenance)
ActorOwnSlab
/actor_in_slab!
for basic child actor housekeepingquery!
macro for convenient access toActor::query
Core::start_instant()
to get runtime startup timeShareWeak
for weak references toShare
items
examples/
folder
- On actor
stop!
orfail!
, if further failures are reported before the actor method returns, the first stop/fail is now kept and later ones are discarded, since the first failure is closer to the origin of the problem.
- Minimum support for asynchronous tasks, in
task
module
(only documentation changes)
PipedThread::new
argument order changed, to avoid need for temporaries when calledActor::kill
,Actor::kill_str
andActor::owned
moved toActorOwn
. This constrains the power to kill an actor and create new owners to just owners. Alsokill_str
now only handles&'static str
, withkill_string
added forString
. If you need to kill an actor using just anActor
reference, then the actor needs a method added that callsfail!
Cx::fail_str
now only handles&'static str
.Cx::fail_string
can be used forString
.fail!
macro now abstracts this.ActorOwn::new
now requires a parent-ID argument.actor!
andactor_new!
macros are unchanged.StopCause
addsStopCause::Lost
to allow for future implementation of remote actors
- "logger" feature for optional logging support. If enabled, every actor gets an span-ID. Actor start and stop are logged, with failure reasons. All logging from an actor uses the span-ID and supports formatted text and key-value pairs. Logging is synchronization-free and is directed to a per-Stakker logging handler, which can output directly, or forward to a logging crate, or forward to the logging system of the host event loop as required
fail!
,stop!
andkill!
to express actor termination more conveniently, including with formatted stringsret_fail!
andret_failthru!
to easily cascade actor failure
Stakker::anymap_set
moved toCore::anymap_set
so that actors can set anymap values more conveniently.
Core::share_rw2
andCore::share_rw3
to allow borrowing 2 or 3Share
instances at once- Allow using
_
in initial closure arguments within macros. For example|_this, _cx|
can now be written|_, _|
PipedThread
now notifies thread as documented if the actor holding thePipedThread
dies.PipedThread
now reports back panic string correctly if thread panics and the panic was made with aString
or&str
.- A timer set at
cx.now()
in virtual time now executes correctly. - The flat
FnOnce
queue has been fixed to run cleanly under MIRI
- Stress tests of
Waker
across threads (to detect races) - Stress test of flat
FnOnce
queue expansion - Fuzz-testing of timer queue
- Fuzz-testing of flat
FnOnce
queue - Unit tests of queue and timers using small corpora derived from fuzz tests
- Unit tests for
Actor
,StopCause
,Share
,Waker
andPipedThread
- Coverage now at 91%
- Tests pass when running under MIRI
- Virtual SystemTime:
cx.systime()
andstakker.set_systime()
- Synchronous actor queries from outside runtime:
actor.query()
- 'flat' FnOnce queue simplifications and improvements
- Global-based Deferrer access is now branch-free
- General optimisations on hot paths
- Fixed memory leak in 'flat' FnOnce queue cleanup
- Fixed memory leak in Stakker cleanup with inline Deferrer
- Fixed issue with TLS-based Deferrer on cleanup
- Valgrind testing script
actor_of_trait!
ActorOwnAnon
- Use
$crate::
instead ofstakker::
for macros - Accept trailing comma in more places in macro args
'static
onActor::apply_prep
is not necessary
- For
call!
-family andfwd_to!
-family macros using closures, no longer requiremove
keyword and make all closures implicitlymove
so that they are'static
-
Ret
type for compile-time checking of single use, instead of oldfwd_once_to!
implementation (now dropped). -
cx: CX![]
to save on actor method boiler-plate
-
Big change to notation within macros, using
[]
to contain the context (Cx
/Actor
/Core
) that the call is targetted towards, which eliminates need for__
arguments. This is still valid Rust syntax, so is formatted automatically by rustfmt.Fwd
handling split out ofcall!
intofwd!
. Error reporting of errors in macro args improved. -
Multiple
ActorOwn
refs to an actor are now permitted, and the ref'd actor is terminated only when the last one goes away -
Deferrer
is now the main queue, not the lazy queue. This is to avoid the lazy queue ballooning whilst there's a lot still going on on the main queue. -
Core::timer_max
dropped in favour oftimer_max!
macro which is more efficient. Similarly fortimer_min
.
- Coverage testing with kcov, and many more tests. Includes coverage testing of macros.
First public release