future Questions

3

Can you convert a Future<String> to a String? Every time I start my application, it should get data from the database, store it in a .csv file, read the .csv file and update some string varia...
Aeolis asked 27/2, 2020 at 17:16

4

Solved

I would like to replicate the behavior and ergonomics of taking a closure/function as an argument much like map does: iterator.map(|x| ...). I've noticed that some library code allows passing in a...
Oletta asked 17/3, 2020 at 7:12

4

I have a total n00b question here on synchronization. I have a 'writer' thread which assigns a different value 'p' to a promise at each iteration. I need 'reader' threads which wait for shared_futu...
Diaconal asked 30/6, 2011 at 21:34

5

Solved

I have the following Java code: final Future future = exeService.submit( new Runnable() { public void run() { myObject.doSomething(); } } ); future.get(); where exeService is an instance o...

5

Solved

Ok, so I know the first answer / comment here will be "use one ExecutorService and use invokeAll". However, there is a good reason (which I will not bore people with) for us keeping the thread pool...
Flavory asked 1/11, 2012 at 18:55

1

I have a piece of code that look like this: final Either<Failure, Unit> resA = await deleteA(); resA.fold( (failure) => handleFailure(), (success) async { final Either<Failure, Unit...
Smokejumper asked 10/10, 2021 at 15:30

4

Solved

I read many articles about R promises (including this) and still don't get it. See code: library(future) library(promises) plan(multiprocess) read.csv.async <- function(file, header = TRUE, ...
Invar asked 25/7, 2019 at 0:7

6

Solved

In asynchronous JavaScript, it is easy to run tasks in parallel and wait for all of them to complete using Promise.all: async function bar(i) { console.log('started', i); await delay(1000); con...
Plumbism asked 20/12, 2015 at 2:7

15

Solved

I have a method which returns a List of futures List<Future<O>> futures = getFutures(); Now I want to wait until either all futures are done processing successfully or any of the tas...
Aardvark asked 13/10, 2013 at 17:42

4

Solved

I was wondering when I should use the future builder. For example, if I want to make an http request and show the results in a list view, as soon as you open the view, should I have to use the futu...
Pontius asked 23/8, 2018 at 9:52

1

Solved

Context I am encountering an issue with FutureBuilder in Flutter where it recreates its Future on every widget rebuild, causing unexpected behavior in my app. Specifically, I have a FutureBuilder t...
Michaelemichaelina asked 4/1 at 18:9

3

I am using a std::future<T> to store the result of an optionally asynchronous operation. Depending on arguments to a function the operation is either asynchronous or synchronous. In the synch...
Hagood asked 13/1, 2020 at 7:58

2

Solved

To avoid my FutureBuilder being called again and again (see this), I have the habbit of calling my futures in initState and it has always worked fine until I had to use nested ones. Basically I wa...
Motivate asked 10/4, 2019 at 13:56

12

Solved

I implemented a listview which get data from a json. I followed this implementation. How could i reverse the order of this listview? (The first element should became the last, ecc...).
Tap asked 28/9, 2018 at 9:35

3

Solved

Python's futures package allows us to enjoy ThreadPoolExecutor and ProcessPoolExecutor for doing tasks in parallel. However, for debugging it is sometimes useful to temporarily replace the true pa...
Savour asked 3/5, 2012 at 15:31

3

Solved

I've got the following piece of code (see playground): use futures::{stream, Future, Stream}; // 0.1.25 use std::num::ParseIntError; fn into_many(i: i32) -> impl Stream<Item = i32, Error = ...
Dinnage asked 23/2, 2019 at 12:58

6

Solved

I have a collection of futures which I want to combine into a single future that gets them executed sequentially. I looked into the futures_ordered function. It seems to return the results sequent...
Dorree asked 3/1, 2018 at 16:53

6

Solved

I'm using Flutter to download 3 different sets of data from a server, then do something with all 3 sets. I could do this: List<Foo> foos = await downloader.getFoos(); List<Bar> bars = ...
Wolverine asked 8/4, 2020 at 16:26

2

Solved

I'm calling an async client method by streaming over a list of objects. The method returns Future. What's the best way to iterate over the list of Futures returned after the call (so as to process...
Umbles asked 5/4, 2017 at 8:55

4

Solved

Is it possible to check if a std::future has finished or not? As far as I can tell the only way to do it would be to call wait_for with a zero duration and check if the status is ready or not, but ...
Purism asked 5/6, 2012 at 0:46

2

Solved

When running the statement from __future__ import annotations I get the following error: Traceback (most recent call last): File "/usr/lib/python3.5/py_compile.py", line 125, in compile _opti...
Fireplace asked 19/10, 2018 at 9:39

1

Solved

When using python async/asyncio, I often create and complete asyncio.Future objects from threads that are not the thread running the event loop. Unless I complete those futures in the thread that i...
Natala asked 11/4, 2022 at 16:33

4

Solved

We use Futures in vertx in examples like: Future<JsonObject> fetchVehicle = getUserBookedVehicle(routingContext, client); fetchVehicle.compose(vehicleJson -> vehicleDoor(routingContext,...
Montford asked 8/11, 2018 at 12:25

2

Solved

I am trying to extend Pharo with promises/futures. I came across this website http://onsmalltalk.com/smalltalk-concurrency-playing-with-futures. It implements futures in Smalltalk. However, when I ...
Whitesell asked 18/4, 2018 at 23:14

2

Solved

The purpose of this question is to understand how Futures are supposed to work in Rust. I do not have a specific piece of code that does not work, but rather a problem understanding how Futures mus...
Profile asked 7/4, 2023 at 15:24

© 2022 - 2024 — McMap. All rights reserved.