Comments (11)
detach()
maybe?
from futures-rs.
Maybe .background()? Or do you think it gives too much of a kernel scheduler vibe?
from futures-rs.
Agreed on the name -- I like ensure
! Though it's a little unclear to me what the ultimate fate of this method should be...
from futures-rs.
Yeah I agree that forget
isn't exactly the greatest name, it's already showing its age as it was originally intended for something completely different! I agree though with @aturon that we should likely figure out the final story for this method first though before tweaking it.
from futures-rs.
We've now since removed forget
, so no longer an issue!
from futures-rs.
xD
from futures-rs.
Out of curiosity, is there a new way to say "complete this future in the background"?
Specifically, it would be nice to have some form of dynamically sized (with an optional maximum?) unordered version of Stream::buffered
that just completes futures returned from a stream as fast as possible. That is, some way to asynchronously dispatch requests and then handle them in order of completion. As far as I can tell, this doesn't exist.
Note: I'm asking because this feature allowed for an inferior version of that primitive through channels (forget a future and have it reply back through a channel when done).
from futures-rs.
@Stebalien The problem with forget
is it wasn't really "in the background"; the future execute on whatever thread last happened to wake it up. Part of the move with executors is to have a much more clear picture of where futures are being executed.
So, when you say "in the background", what do you have in mind?
from futures-rs.
@aturon I need a way to drive an unbounded number of futures at the same time. I didn't actually like how forget
worked as I'd prefer to be able to choose where the futures are completed but it "worked".
Basically, I need something like select_all
but I need it to take a stream, not an iterator, because I don't have a bounded number of futures. I'll write up a full report (and maybe implement it) after turning in my thesis...
from futures-rs.
@alexcrichton I've updated futures-rs in my project and am now seeing that .forget()
has been removed, but what is it replaced with? I removed all the .forget()
calls in my project, but now I'm getting
warning: unused result which must be used: futures do nothing unless polled, #[warn(unused_must_use)] on by default
in all the places it was removed. How do I actually drive futures forward now? I've looked into executors and tasks in the docs, but I can't find an obvious way to run a future chain.
from futures-rs.
Oh, actually I see in some places you do
let future = ...;
thread::spawn(move || {
future.wait();
});
However this seems to run the future chain on the new thread, not the thread the future is created on. Is there a way to execute a future equivalent to what .forget()
used to? Thanks!
EDIT: Nevermind, see #332
from futures-rs.
Related Issues (20)
- Analogue of .last() method
- parse error in `select!`/`select_biased!` macro HOT 2
- Error on OSX by futures-executir HOT 1
- Consider removing ArcWake, re-export std::task::Wake HOT 3
- Fine-tune the Ordering for num_senders
- Feature Request: make FuturesUnordered splitable.
- `FuturesUnordered` guaranties
- Unbounded memory use of `futures::channel::mpsc` with `SinkExt::feed`
- Question: futures-rs::channels implement Send trait HOT 1
- Non-send future produced by chaining `Stream` combinators HOT 1
- Behavior of any() / all() / try_any() / try_all() is not documented for empty stream
- Feature request: add `StreamExt::eq` like `Iterator::eq`
- Reusing `AbortRegistration`
- ConcurrentStream usage with tokio leads to ACCESS_VIOLATION HOT 3
- [Discussion] `Shared` seems to wake up the same waker that was polling it HOT 1
- Add `StreamExt::map_while`
- io: impl AsyncWrite for Empty
- Stream & Sink Error types could benefit from core::fmt::Debug bound HOT 1
- implement OwnedMappedMutexGuard
- `StreamExt::scan` lacks a non-Option version
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 futures-rs.