Batch request to support processing record as soon as it arrives

For batch query, clients normally wait until all keys are retrieved from the server nodes before it returns control to the caller. Some clients such as the C client support delivering each record as soon as it arrives, allowing client applications to process data from the fastest server first. (ref https://www.aerospike.com/docs/guide/batch.html) Will Java client support such feature so that caller can be able to process records as soon as possible?

The java client already supports delivering each record as soon as it arrives in async batch commands.

	public final void get(EventLoop eventLoop, BatchSequenceListener listener, BatchPolicy policy, List<BatchRead> records) 
	public final void get(EventLoop eventLoop, RecordSequenceListener listener, BatchPolicy policy, Key[] keys)
	public final void get(EventLoop eventLoop, RecordSequenceListener listener, BatchPolicy policy, Key[] keys, String... binNames) 
1 Like

Thanks a lot! Sorry I missed these methods.

I would like to confirm one more thing using this opportunity. Just to double confirm. Actions (like data parsing) done in listeners will not block event loop, right?

No. Listeners are called directly from the event loop thread. Long running actions need to be offloaded to another thread.