Hi Tim,

The replyCallback must be called for every replayed message -- this is how
you actually do the replay itself. Since the doAsyncReplayMessages
operation might be asynchronous, when this method returns it does not mean
that the replay has been completely finished. Instead it returns a future,
which can be used to listen for the actual completion.

There are examples how to use the Future API from Java in the Akka docs:
http://doc.akka.io/docs/akka/2.3.5/java/futures.html#Use_Directly

You can call Futures.future(callable, executionContext) where the callable
would fetch the List<Messages>, call the replyCallback on each of them and
then finish. That callable must have a return type of Void to match the
expected return type Future<Void>.

-Endre


On Tue, Aug 26, 2014 at 10:27 AM, Tim van Cann TH <[email protected]>
wrote:

> I am currently in the process of writing my own plugin for the Akka
> SyncWriteJournal API to implement the connection with HSQLDB.
>
> The problem is that I do no understand the requirements for the method
> doAsyncReplayMessages. It states that it needs to return a future and that
> all the messages should be called by replayCallback.
>
> Let's say that I have a query which returns a list of messages:
> List<Message> messages. Can anyone provide a minimal example (with
> explanation) of how to use replayCallback, and Future to implement the
> method correctly by using that list? How would replayCallback and Future
> work together and what should be returned by the method
> doAsyncReplayMessages?
>
> Thanks!
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to