Skip to content Skip to sidebar Skip to footer

Control An Automated Function Manually

Well I apologize for not so specific and clear title (tried too hard for it ), so I have this function public void fetchData(){ dataQuery.setPageSize(10); // fetch 10 items p

Solution 1:

Remove countdown latch and change the signature like this:

public void fetchData( int offset )

In the implementation, keep the code to set the page size, but also add this:

dataQuery.setOffset( offset );

That will fetch the next page of data from the specified offset. There is no need to call nextPage in the responder. The result you get will be the block of "pageSize" records from the specified offset.


Post a Comment for "Control An Automated Function Manually"