Comments (5)
@rmanoka Please, take a look at #16 for an implementation and review
from async-scoped.
Nice work @ftelnov .
I think I'd made the trait private, to ensure we're not violating any rust memory invariants. In particular, I wasn't sure if there's a safe-rust executor, whose guarantees may not match the requirements of this crate, and hence implementing the traits on this executor leads to memory-UB even via safe-rust.
As an escape hatch, I'm okay with making the trait unsafe, and explaining that the user has to prove/verify the necessary things before exposing it via safe-rust.
from async-scoped.
At the first glance at feature gates I realized you actually did it on purpose. Thanks for the explanation!
I think we simply can mark the traits unsafe, because it solves the problem and delegates responsibility of necessary checks to the end-user. I also think it's okay from the perspective of unsafe-code pervasivity - in the end, those traits are not being implemented often.
I've added unsafe markers and write yet simple top-level comment about traits unsafety.
But what should be additionally done is invariants definition. What contracts must implementer of these unsafe traits uphold? In other words, what are requirements for the executor? Do we have an example of the dangerous executor?
from async-scoped.
Thanks @ftelnov ; have merged this. I'll release it in the next couple weeks.
from async-scoped.
Released as 0.8.0
from async-scoped.
Related Issues (18)
- Compilation error, failed inference on closure HOT 3
- Return result containing references HOT 2
- Support for spawn_blocking HOT 5
- Why is async_scope blocks some writes to file? HOT 2
- panic when calling scope_and_block HOT 7
- Allow async block in `scope_and_block` and `scope_and_collect` HOT 1
- docs bug
- Question: using async-scoped with for_each_concurrent HOT 2
- Release async-scoped 0.9 version HOT 7
- scope_and_collect should return results in order of submission HOT 2
- tokio? HOT 5
- Limiting concurrent tasks HOT 1
- handle references in function results HOT 4
- Tokio 1.0? HOT 3
- Compilation error after Rust nightly 2021-01-10 HOT 12
- Compile fails when using async-std without the attributes feature enabled HOT 2
- Question about `spawn_cancellable` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-scoped.