WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to use the crate smol-axum, but I've encountered a compile error (documented better here notgull/smol-axum#3)
TL;DR + additional info: this change 58e0e7d seems to be breaking smol-hyper's implementation of Executor, which implements it over async_executor's executors. It goes like this:
Where SmolExecutor is a wrapper to a type that derefs to an executor from smol crate
The issue lies when passing this smol executor to an http2 builder and calling serve (try to compile smol-axum's hello example after running cargo update), the reference in SmolExecutor goes out of scope but the SmolExecutor is still in use
As the author of both crates has stated that they won't be very active now, I wanted to help out and fix this myself, however I lack the technical skill, and trying to get to understand this project is a hard task.
I struggle to find what's so different after the commit that made this no longer work, I'd guess the fact there is an added E generic trait parameter to a lot of types is holding hostage the SmolExecutor but not the underlying executor which slips out of scope
Reading what I can find about hyper's executor trait, all the examples operate over a globally defined executor, with static lifetimes, so there's never an issue
So, my question is: Is the implementation of an Executor over a non static lifetime possible, or was it an oversight to begin with?
If it's possible, an example would be much appreciated. If it's not, what could be done to circumvent the issue, aside from the worst case scenario of "make the executor global" which defeats the whole purpose of using smol imo
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am trying to use the crate smol-axum, but I've encountered a compile error (documented better here notgull/smol-axum#3)
TL;DR + additional info: this change 58e0e7d seems to be breaking smol-hyper's implementation of Executor, which implements it over async_executor's executors. It goes like this:
Where
SmolExecutoris a wrapper to a type that derefs to an executor from smol crateThe issue lies when passing this smol executor to an http2 builder and calling serve (try to compile smol-axum's
helloexample after running cargo update), the reference in SmolExecutor goes out of scope but the SmolExecutor is still in useAs the author of both crates has stated that they won't be very active now, I wanted to help out and fix this myself, however I lack the technical skill, and trying to get to understand this project is a hard task.
I struggle to find what's so different after the commit that made this no longer work, I'd guess the fact there is an added E generic trait parameter to a lot of types is holding hostage the
SmolExecutorbut not the underlying executor which slips out of scopeReading what I can find about hyper's executor trait, all the examples operate over a globally defined executor, with static lifetimes, so there's never an issue
So, my question is: Is the implementation of an Executor over a non static lifetime possible, or was it an oversight to begin with?
If it's possible, an example would be much appreciated. If it's not, what could be done to circumvent the issue, aside from the worst case scenario of "make the executor global" which defeats the whole purpose of using smol imo
Beta Was this translation helpful? Give feedback.
All reactions