# Batch request to support processing record as soon as it arrives

**URL:** <https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106>\
**Category:** Java Client\
**Created:** [December 23, 2020, 11:33am UTC](https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106 "2020-12-23T11:33:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![junshiguo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/junshiguo/32/1587_2.png) [@junshiguo](https://discuss.aerospike.com/u/junshiguo)\
**Post date:** [December 23, 2020, 11:33am UTC](https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106/1 "2020-12-23T11:33:29Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [December 23, 2020, 7:27pm UTC](https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106/2 "2020-12-23T19:27:36Z")

</div>

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

```auto
	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) 

```

---

<div class="post-metadata">

**Author:** ![junshiguo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/junshiguo/32/1587_2.png) [@junshiguo](https://discuss.aerospike.com/u/junshiguo)\
**Post date:** [December 24, 2020, 3:22am UTC](https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106/3 "2020-12-24T03:22:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [December 24, 2020, 8:30pm UTC](https://discuss.aerospike.com/t/batch-request-to-support-processing-record-as-soon-as-it-arrives/8106/4 "2020-12-24T20:30:29Z")

</div>

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