Skip to main content

All Questions

0 votes
2 answers
105 views

How can a Callable return a value from a predefined void callback?

I am using a data-related API interface which has a key void callback function that is automatically invoked to mark the end of some IO operations. I want to make the class Callable<String> and ...
limestreetlab's user avatar
1 vote
1 answer
233 views

How to return a value retrieved inside a callback function's void overriden method?

I have the following function, which returns a long value. However, that long value (result.id.longValue()) is retrieved inside a callback's void overridden method, so I can't just return the ...
Adam Lee's user avatar
  • 586
-1 votes
2 answers
794 views

How to make REST call asynchronous in Java

I have REST calls between two microservices, one of the call is taking more than 15 mins of time to complete. We have company's own private cloud implementation which is terminating any open ...
Kartik Kodag's user avatar
0 votes
1 answer
692 views

How to execute callback of async call on Java's main thread?

Is there a way to force the execution of the callback to be executed on the main thread? For example, in the following code: public static void main(String[] args) throws Exception { ...
Barak Sason Rofman's user avatar
0 votes
1 answer
387 views

Jersey InvocationCallback Completed: Which thread is used to invoke these methods

I am working on a Async Processing Module and Implemented Jersey Invocation Callback. My implementation is straight forward and am defining a Completed and Failed methods as mentioned in https://docs....
varkashy's user avatar
  • 395
1 vote
1 answer
79 views

How to handle asynchronicity on Android Java?

I'm using OkHttp to send REST requests to the server, and the responses are returned asynchronously. Since Java is primarily a server-side language, the concept of handling asynchronous returns are ...
Hung Vu's user avatar
  • 380
0 votes
1 answer
40 views

How can I listen for events in my activity waiting for a computation to finish?

I have a main activity which needs to listen for the results of computation on an audio stream so. Here's the main activity private void setSoundProcessListener() { SoundProcess object = new ...
ab3rc's user avatar
  • 51
0 votes
1 answer
3k views

java Catch exception inside a async callback

I have a callback which may throw a custom exception. I'm trying to throw it, but it's not being catched on the outer scope, nor the compiler let me catch it, it says: "Exception is never thrown ...
Finer's user avatar
  • 19
1 vote
1 answer
340 views

Java/Firestore - Wait for data to be read before looping to next item (Async)

I am trying to implement a VMMV architecture on my project in order to have low coupling between objects. I have 2 entities in my Firestore database: Offers and Users. Each offer is posted by a user. ...
Vlad-Rares's user avatar
0 votes
0 answers
45 views

Callback Problems with Firebase and Android

I have a problem when I am fetching my Data from Firebase Firestore. I want to get multiple Documents out of my "Posts" collection and that works fine. But to get my user documents out of my "Users" ...
HSchlong's user avatar
0 votes
1 answer
546 views

How do I get a data from a Retrofit onResponse

I want to get an ArrayList<ItemList> from my Retrofit Callback and save it in as a ArrayList variable in my class. In other word I need to use data from retrofitList even when I leave the ...
user3503234's user avatar
0 votes
3 answers
35 views

Return value of interface method (no params) is acquired asynchronously. Can it be implemented?

I've been given an interface which is like this: MyInterface { List<FirebaseVisionFace> getFaceList(); } I have to implement it in a class (let's call it MyFirebaseFaceClass) in such a way ...
CodeNovice's user avatar
0 votes
2 answers
2k views

Async callback and listener

I have the following interfaces: public interface NumberOfCellsListener { public void numberOfCellsChanged(int patientId, int numOfCells); } public interface NumberOfCells { public void ...
Dev2017's user avatar
  • 938
0 votes
0 answers
64 views

How to return the value of an asynchronous callback?

This is my code, it's a query to mysql for return 1 or 0, if exist a element in database. I want to know how I get the value? private void comprobarUsuario(String url){ JsonArrayRequest ...
Javier Marín's user avatar
2 votes
0 answers
442 views

How to properly await the completion of multiple async calls from a swagger client in java?

I need to make multiple asynchronous calls through a Swagger generated client, and await the completion of all of the request before continuing. Ideally, I want the request to be made in parallel with ...
funkymanband's user avatar

15 30 50 per page