future Questions
1
I am about to convert some code from futures-0.1 to futures-0.3 where the poll() methods require pinned data now. Some of my structs are unpinnable which complicates the porting. But there seems to...
6
I am a newbie to scala futures and I have a doubt regarding the return value of scala futures.
So, generally syntax for a scala future is
def downloadPage(url: URL) = Future[List[Int]] {
}
...
1
Solved
I'm new to EventLoop futures and promises. My software stack:
Backend in Go + gRPC
iOS client in Swift + SwiftUI + GRPC + NIO
I've got something to work and looking for suggestions on how to im...
1
Solved
I have always used recover to transform exceptions in failed futures similar to
def selectFromDatabase(id: Long): Future[Entity] = ???
val entity = selectFromDatabase(id) recover {
case e: Data...
2
Solved
This works:
let fut = Arc::new(Mutex::new(Box::pin(async { 1 })));
let mut conn_futures = BTreeMap::new(); // implicitly typed
conn_futures.insert(123, fut);
if let Some(fut) = conn_futures.get_m...
2
I seek to parallize an R file on an SLURM HPC using the future.batchtools packages. While the script is executed on multiple nodes, it only use 1 CPU instead of 12 that are available.
So far, I t...
Granddaughter asked 26/7, 2019 at 14:50
1
Solved
What type should I use for a vector that stores futures?
I tried to make multiple concurrent requests on the same URL and save all the futures into the vector to use with join_all.
If I don't set...
Interstitial asked 8/11, 2019 at 7:28
4
I come asking for quite a specific question regarding Flutter and the Future and await mechanism, which seems to be working, but my Clipboard does not really function while operating with my editab...
Randyranee asked 20/11, 2018 at 12:10
3
Solved
I'm trying to cancel an interval (interval_timer) after emptying a queue but not sure what is the right strategy.
let mut some_vars = vec![1, 2, 3, 4, 5, 6, 7, 8];
let interval_timer = tokio_timer...
Confiscatory asked 12/3, 2018 at 12:57
1
Solved
The async/await feature is coming soon, but there are a lot of libraries still using futures 0.1. How do we convert between the two?
Convert an async future to 0.1 future covers converting an asyn...
1
Solved
I have a Vert.x 3.7.1 method that deploys a bunch of verticles and if all of the deployments succeed, sends a message through the event bus that does some startup work. The structure of the method ...
2
Solved
I have a function which returns images directory path, it performs some additional check like if directory exists or not, then it behaves accordingly.
Here is my code:
Future<String> getIma...
Respondent asked 21/9, 2019 at 8:18
2
Solved
I'm trying to catch the error when my device has no internet connection. I've built out 2 future methods, 1 to import a json and 1 to look into the database. I have a future builder that's suppose ...
6
Solved
What is the best way to construct a completed future in Java? I have implemented my own CompletedFuture below, but was hoping something like this that already exists.
public class CompletedFuture&...
1
Solved
I have an R Shiny dashboard that has 2 observers that are set to refresh at specific times, One observer refreshes every 6 hours, the other every 2 mins. Both observers run a function that returns ...
1
Solved
I want to use the async function to parse the inbound stream progressively, but actix-web requires impl Future<Item = HttpResponse, Error = Error> as the return value.
How can I convert the f...
4
Solved
My problem is how to use Completable Future.
I have a class that implements Callable.
public class Executor implements Callable<Collection>
Earlier is used to do -
service.submit(collect...
Vyner asked 9/3, 2015 at 13:20
4
Solved
I have a Java Future object which I would like to convert into a Scala Future.
Looking at the j.u.c.Future API, there is nothing much that I could use other than the isDone method. Is this isDone ...
Fatherhood asked 27/1, 2016 at 9:23
1
I am trying to use futures to have a "loading" icon appear. This is the code I have
library(shiny)
library(promises)
library(future)
plan(multiprocess)
disksUI <- function(id) {
ns <- NS(...
2
Solved
When I run my app it throws a lot of errors, and the red/yellow error screen on my device, which refreshes automatically and shows me the expected output then.
From the log I can see that first my...
Impartial asked 19/8, 2019 at 6:29
1
Solved
I am attempting to create a struct that will allow someone to call .shutdown(), which will resolve a future (that is otherwise pending). It can only be called once. In the implementation of the Fut...
8
Solved
This is a follow-up to my previous question
Suppose I want to create a future with my function but don't want to start it immediately (i.e. I do not want to call val f = Future { ... // my functio...
Smile asked 15/5, 2013 at 20:44
3
Solved
I was trying to implement a simple login/logout functionality. My scenario is this:
I have 2 pages ( login page and home page), In the main.dart, I am using SharedPreferences to check if a user has...
Helms asked 27/7, 2019 at 13:1
2
Solved
I can find neither direct confirmation nor refutation on the matter. All answers seem to address the "access from multiple threads" aspect, rather than repetitive access itself.
Does the standard ...
3
Solved
Suppose I've got a function op: (Int, Int) => Future[Int] and need to write a new function foo :
def foo(xs: Seq[Int],
zero: Int,
op: (Int, Int) => Future[Int]): Future[Int] = ???
foo ...
Disapprobation asked 19/6, 2019 at 9:30
© 2022 - 2024 — McMap. All rights reserved.