Skip to content

Commit

Permalink
Add note about smol and async-executor in scheduler struct
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Sep 17, 2023
1 parent 2e9ff35 commit 5a6a8a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lune/scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ pub(crate) struct Scheduler<'fut> {
state and receiver to know when we have run to completion.
If we have no senders left, we have run to completion.
Once we no longer store futures in our scheduler, we can
get rid of the lifetime on it, store it in our lua app
We should also investigate using smol / async-executor and its
LocalExecutor struct which does not impose the 'static lifetime
restriction on all of the futures spawned on it, unlike tokio.
If we no longer store futures directly in our scheduler, we
can get rid of the lifetime on it, store it in our lua app
data as a Weak<Scheduler>, together with a Weak<Lua>.
In our lua async functions we can then get a reference to this,
Expand Down

0 comments on commit 5a6a8a0

Please sign in to comment.