3,898 questions
Score of 3
1 answer
130 views
Future.pause delays longer than the specified Duration
Dart's Future.pause seems to delay the execution of a program longer than the Duration specified when calling the function. Consider the program below (running on a Linux machine):
import 'dart:async';...
Score of 0
0 answers
169 views
How to express type bound for future capturing lifetime of parameter
I am trying to store a function for<'a> FnOnce(&'a Data) -> (impl Future + 'a), but unfortunately we cannot express this as impl Future is not allowed in this position. I tried to ...
Score of 4
0 answers
165 views
Is `boundary`/`break` fundamentally incompatible with `Future`-based concurrency?
I'm on Scala 3.8.2 / JDK 21 and trying to combine boundary/break with Future to bail out of a parallel operation as soon as the first failure hits.
Here's a stripped-down version. Synchronous boundary/...
Score of 0
1 answer
149 views
Flutter: SharedPrefs is not setup in time on real devices
I have this app that before the main page is constructed, I have a FutureBuilder that does some setup on the SharedPreferences that must happen before anything else. I think I did all that correctly, ...
Score of -1
1 answer
166 views
future module in debian
I want to use this app. As it is mentioned in the README.md it needs the future module of python. I have debian sid and python3-future is removed from the repos of apt. When I install it via its setup....
Score of 1
1 answer
103 views
Behaviour of vertx Future.all
With Vertx futures, we have
CompositeFuture fRes1 = Future.all(f1, f2, f3);
CompositeFuture fRes2 = Future.join(f1, f2, f3);
Future.join will wait for all three underlying futures to fail to then ...
Score of 0
1 answer
203 views
How can I create a single function in Rust that accepts both sync fn and async fn?
I’m building a small web server in Rust and I want the server’s add_route method to accept both synchronous and asynchronous handlers ergonomically.
Goal: allow end-users to write code as simple as:
//...
Score of -1
1 answer
75 views
Animation fails in debug mode app despite check and wait for widget addition to widget tree
I am using expandable_page_view as in the following code setup. Initially when I coded the code in First attempt in the initState method, now commented, the code ran as expected in the real Android ...
Score of 0
1 answer
155 views
Return timing of dart `Future` objects in asynchrounous functions
First, Please correct me anything I inferred about asynchrounous programming in dart, and even what I summarized from the docs,
And please check if my idea about when Future objects are correct. I ...
Score of 0
1 answer
122 views
Block execution till a Rust future is resolved on WASM without wasm bindgen
I am using a library (Macroquad) that has an async function with following signature:
async fn load_file(path: &str) -> Vec<u8>
This loads the file and returns the raw bytes.
Is there a ...
Score of 3
1 answer
111 views
How to cancel a task which includes a file operation?
Reproducible code snippet:
#[tokio::main]
async fn main() {
let (tx, rx) = oneshot::channel();
let a = tokio::spawn(async move {
tokio::select! {
_ = rx => {}
...
Score of 0
1 answer
107 views
Async calls to CLI tool in separate folders
I like to call a command line utility from R and parallelise the tool by calling several copies of it in different folders. Each call can have quite different runtimes, so I'd like to do this in an ...
Score of 1
1 answer
138 views
Usage of options(warn=2) and tryCatch() with purrr R library
I am most likely not doing the right thing below, why do I get different answers?
library(furrr)
fu=function(x){
options(warn=2)
b=x
tryCatch({b=as.numeric('b')},error=function(e){})
options(...
Score of 0
0 answers
93 views
scala's future block cannot access variables from outside
I'm learning Scala futures and I got stuck (or deadlocked) at this piece of code:
package exercises.ch4
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration....
Score of 2
2 answers
288 views
Can't make `future` work in parallel and concurrently on several (logical) cores
Within a Shiny app, a task that is triggered by a button is taking quite a long time to complete (synchronous sequential code).
That's why I want to split this task over several (logical) cores of my ...