future Questions

2

I was going over a lesson on async programming with Dart but for some reason I am getting kind of confused. I think I understand the concepts of how you should be using an async function when it ma...
Sycosis asked 10/6, 2019 at 4:0

4

Solved

I'm mostly using programming languages like Scala and JavaScript. I'm trying to understand the similarities and differences in how async reactive programming is used in both languages. Can you help...
Judsonjudus asked 28/3, 2014 at 23:24

0

I have been trying to use Futures library in my Shiny code in order to make a particular task asynchronous, which is time taking. The promise handler of this Future object works well in reactive, e...
Embolism asked 29/5, 2019 at 6:40

1

Solved

I am attempting to create simplest possible example that can get async fn hello() to eventually print out Hello World!. This should happen without any external dependency like tokio, just plain Rus...
Retouch asked 22/5, 2019 at 8:48

1

Solved

Is there a difference between an async method that returns void, and one that returns Future<void>? It seems that both are valid in Dart: void main() async { await myVoid(); await myFuture...
Oppose asked 21/5, 2019 at 18:0

1

Solved

From http://www.cplusplus.com/reference/future/promise/get_future/: After this function has been called, the promise is expected to make its shared state ready at some point [...] I'm unsure i...
Seneca asked 15/5, 2019 at 10:30

2

Solved

I'm writing a future combinator that needs to consume a value that it was provided with. With futures 0.1, Future::poll took self: &mut Self, which effectively meant that my combinator containe...
Nagpur asked 9/5, 2019 at 11:33

2

Solved

The following code crashes in random intervals when built with MSVC under Debug mode, unlike the Release. #include <future> using namespace std; int main() { auto l = [](){}; auto f = as...
Suzannesuzerain asked 15/9, 2017 at 18:58

3

def testThrowException(number: Int): Future[Int] = { if (number == 0) { throw new Exception("number is 0") else { Future{1} } for the above function, if i call it with testThrowException(0),...
Chicane asked 12/5, 2019 at 21:59

1

Solved

I am writing an Akka HTTP Web API, that connects to an Oracle Database instance using OJDBC. To my knowledge there is no asynchronous JDBC API to connect to the database, nor there is a callback im...
Kuhl asked 11/5, 2019 at 17:16

3

Solved

I want to poll an API endpoint until it reaches some condition. I expect it to reach this condition in couple of seconds to a minute. I have a method to call the endpoint that returns a Future. Is ...
Laciniate asked 11/4, 2019 at 17:7

2

I am replacing synchronous socket code written in Rust with the asynchronous equivalent using Tokio. Tokio uses futures for asynchronous activity so tasks are chained together and queued onto an ex...
Cholla asked 13/3, 2018 at 11:11

3

Solved

I know this is quite an open ended question and I apologize. I can see that Await.ready returns Awaitable.type while Await.result returns T but I still confuse them. What are the difference betwe...
Selffulfillment asked 15/12, 2016 at 17:43

1

Solved

Since the Coroutines TS has been accepted into C++20 at the ISO meeting at Kona, I started playing around with them a bit for myself. Clang already has decent support for coroutines but the impleme...
Devin asked 9/3, 2019 at 23:19

1

Solved

I am learning to use Rust futures and I am finding it extremely confusing. I feel like I am being stupid but when would then, and_then and or_else be used? What return types are expected? Please ...
Edmonton asked 6/4, 2019 at 18:53

1

Solved

I'm trying to use scalatest Asynchronous Test Suites, but aside from some restrictions over setting timeout and what not, I don't see what does the test suite actually add. I wonder if anyone ver...
Bequest asked 3/4, 2019 at 5:44

3

Solved

I have a generated java interface containing a method: public Future<?> getCustomersAsync(AsyncHandler<Customer> asyncHandler); I want to implement it using Akka. I wrote following: ...
Indeciduous asked 2/2, 2015 at 12:31

2

Solved

I have some tasks that need to be performed asynchronously, and the server can't close while there are still tasks running. So I'm trying to store the futures returned by std::async in a list, but ...
Chastise asked 18/3, 2019 at 10:55

2

Solved

Here's an example of using Tokio to run a function that returns a future: use futures::sync::oneshot; use futures::Future; use std::thread; use std::time::Duration; use tokio; #[derive(Debug)] st...
Leandra asked 14/3, 2019 at 5:26

3

Solved

I have a scenario in my code where I need to make a Future fail based on a successful result that contains a certain value. I can make this work just fine via flatMap, but I want to know if there i...
Mis asked 22/5, 2013 at 14:56

3

Solved

In a language like C#, giving this code (I am not using the await keyword on purpose): async Task Foo() { var task = LongRunningOperationAsync(); // Some other non-related operation AnotherOpe...
Agenesis asked 16/10, 2018 at 12:42

2

I have a client handling a Future that does some stuff. Is it possible to use impl Future<Item = (), Error = io::Error> as a return type and make better error handling? pub fn handle_client(...
Elbrus asked 28/2, 2019 at 8:24

1

Solved

There is a slight bug in my app made with Flutter, that when the user has signed in, it fetches the user information from my database but not fast enough and causes a visual error on my front end o...
Evette asked 11/2, 2019 at 15:58

1

Solved

I'd like to spin up a Tokio event loop alongside a Rocket server, then add events to this loop later on. I read Is there a way to launch a tokio::Delay on a new thread to allow the main loop to con...
Euh asked 10/2, 2019 at 3:6

1

Solved

I have a long list of futures which I'd like to run using Stream::buffer_unordered/Stream::buffered. I combine this stream into a single future with for_each and then execute it all with Tokio. It ...
Gigot asked 8/2, 2019 at 14:15

© 2022 - 2024 — McMap. All rights reserved.