future Questions
2
Solved
I have a C++11 program that checks whether a number is prime. There is a future object that the program waits for to be ready. After it is ready, the program tells whether a a provider function of ...
Heber asked 19/6, 2014 at 7:26
9
Solved
Is it possible to disable future date from today?
Let say today is 23/10/2010, so 24/10/2010 onwards are disabled.
Sorry I am very new in jQuery and JavaScript.
Shapeless asked 23/10, 2010 at 6:16
2
Solved
I'm very glad to use typing module in Python 3. Also, I'm very glad to use asyncio instead of twisted, tornado and alternatives.
My question is how to define result of a coroutine properly?
Should ...
Mendelevium asked 15/7, 2017 at 7:52
4
I know that the apply method of Function returns an object synchronously, and the apply of AsyncFunction runs asynchronously and returns a Future.
Can you give me an example of when to prefer what...
Euhemerize asked 5/6, 2014 at 0:6
1
Solved
While answering this question, I noticed a strange behaviour of CompletableFuture: if you have a CompletableFuture cf and chain a call with cf.exceptionally(), calling cf.get() appears to behave st...
Caban asked 16/6, 2017 at 15:38
3
Solved
Without Future, that's how I combine all smaller Seq into one big Seq with a flatmap
category.getCategoryUrlKey(id: Int):Seq[Meta] // main method
val appDomains: Seq[Int]
val categories:Seq[Meta]...
Antisepsis asked 16/6, 2017 at 9:38
3
Solved
I have to make Rest API invocation using RestTemplate multiple time with different parameters. API is same but it is the parameter that is getting changed. Number of times is also variable. I want ...
Abradant asked 8/6, 2017 at 2:22
3
Solved
From java docs on Future.cancel()
boolean cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task. This attempt will fail if the task has already completed, has already...
Iain asked 29/1, 2014 at 23:51
2
The following example is taken from a C++ async tutorial:
#include <future>
#include <iostream>
#include <vector>
int twice(int m) { return 2 * m; }
int main() {
std::vector&l...
Belgae asked 4/6, 2017 at 12:16
1
Solved
I try to submit and get 10 Futures in the same stream. Each one takes 1 second to process and I would like to run them in parallel.
My first try is takes_10_sec() which runs sequentially and takes...
Wifehood asked 1/6, 2017 at 4:31
2
Solved
I found out that in order to pattern match Future fur Success/Failure, I need to use andThen (or onComplete, onSuccess...) and cannot use map. Why is that?
What I wanted to do (simplified, I am ma...
Liles asked 18/5, 2017 at 11:33
3
The ExecutorService has the following method:
Future<?> submit(Runnable task)
But since this Future's get method will always return null wouldn't the following signature be more appropriate?
...
Sunglasses asked 15/5, 2017 at 8:7
1
Solved
1
io.grpc.StatusRuntimeException: CANCELLED
at io.grpc.Status.asRuntimeException(Status.java:539)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal....
Osswald asked 20/4, 2017 at 5:51
3
Solved
I have the following code where I have a list of usernames and I try and check if the users are in a specific Windows Usergroup using net user \domain | find somegroup.
The problem is that I run t...
Foreyard asked 22/4, 2017 at 10:15
1
Solved
Who owns the shared state in futures and promises? In particular who is responsible for the construction and deletion of the shared state in these classes? Or is the shared state supposed to be ref...
2
Solved
In my Fragment, i am trying to use TMDB's open movie DB to get details about "Now Playing" Movies.
If i use RequestFuture.get(time, TimeUnit) method to execute this volley request i always get a t...
Pickering asked 30/5, 2015 at 17:33
1
Solved
I was looking for a data type for asynchronous operations.
I found that scalaz.ContT[Trampoline, Unit, ?] supports all features in scalaz.concurrent.Future, in addition of BindRec.
Though, there ...
Antisemite asked 31/3, 2017 at 14:27
3
Solved
In shiny, it is possible to call client-side callbacks written in javascript from the server's logic. Say in ui.R you have some JavaScript including a function called setText:
tags$script('
Shiny...
1
iam trying a new query with nhibernate and find a new problem :(
take this as model:
public class D { int id; }
public class C { int id; }
public class B {
int id;
ICollection<C> Cs;
ICo...
Indebtedness asked 21/3, 2017 at 14:5
1
Solved
val future = Future {
println("hello")
Thread.sleep(2000)
}
future.onComplete(_ => println("done"))
The code in the future above blocks.
My question is: since Future uses an ExecutionConte...
Tampa asked 27/3, 2017 at 20:10
1
I am debugging an issue in my android app. I found the root cause is file descriptors went beyond the limit. After further investigation I found that the app has too many sockets open. I use OkHttp...
2
Solved
I want to do error handling in my play scala web application.
My application talks to the data base to fetch some rows, it follows following flow.
First call to db to fetch some data
Use the dat...
Salvidor asked 30/8, 2015 at 3:2
4
I'm trying a program:
#include <iostream>
#include <thread>
#include <future>
int foo() {
return 0;
}
int main(int argc, char* argv[]) {
for (auto i = 0L; i < 10000; ++i) ...
2
Solved
In Scala, a Future is defined to be covariant whereas a Promise is invariant. It is said that a Promise can almost be made contravariant (https://issues.scala-lang.org/browse/SI-7467). Why is this ...
Wilhite asked 13/3, 2017 at 16:19
© 2022 - 2024 — McMap. All rights reserved.