How can i get a callback after an asynchronous operation is over?

143 views
Skip to first unread message

Barak Cohen

unread,
Jul 27, 2014, 11:28:55 AM7/27/14
to spring-dat...@googlegroups.com
Hi,

I am using CassandraTemplate.insertAsynchronously and CassandraTemplate.deleteAsynchronously and i want to be able to know that the operation finished successfully or with errors (i don't want the thread to wait on a synchronous operation but to get notify on the result).
how can i do that? 

i saw that the general execute method has a callback argument but i think it makes more sense to have one in the async insert/delete methods.

same for the select method which handles the objects mapping to my type automatically but if i want to use async query then i need to use queryAsynchronously which doesn't handles the mapping.

would appreciate your help if there is a better way to do those asyn operations or alternatively if you can expand the API (callbacks for insert/delete and async method for select).

thanks,
Barak

This message may contain confidential and/or privileged information. 
If you are not the addressee or authorized to receive this on behalf of the addressee you must not use, copy, disclose or take action based on this message or any information herein. 
If you have received this message in error, please advise the sender immediately by reply email and delete this message. Thank you.

Matthew Adams

unread,
Jul 29, 2014, 11:12:02 AM7/29/14
to spring-dat...@googlegroups.com
I just reviewed the code, and agree that the async operations should probably be overloaded to take optional callbacks.

Please enter an issue requesting that async repository operations be overloaded to take optional callbacks.  As part of the work for this issue, we should probably have a look at the lower level CqlOperations interface as well to see if its async ops need overloading as well.

-matthew

Barak Cohen

unread,
Jul 29, 2014, 11:48:49 AM7/29/14
to spring-dat...@googlegroups.com
thanks,

Reply all
Reply to author
Forward
0 new messages