Improve usability of the Spawn trait #311
Labels
enhancement
An improvement of the API.
priority:low
Low priority issue.
RT
Related to the Heph-rt crate.
In commit c33ed02 (issue #279) a new
Spawn
trait was introduced. It comes with three generic parametersS
(Supervisor
),NA
(NewActor
) andRT
(eitherThreadLocal
orThreadSafe
). This was required because spawn of thread-safe actors requires,S
,NA
andNA::Actor
to beSend + Sync
, while thread-local actors don't have this requirement. However when using async function as actor we can't nameNA
orNA::Actor
, making this trait impossible to use with it.My initial idea was to split the two traits:
Spawn
andSpawnLocal
, but types likeTcpServer
need a single trait otherwise we have to implement that twice as well.The text was updated successfully, but these errors were encountered: