I am writing a server client application, best performance is a must; I am using RMI for server-client communication, the server uses mySQL database.

Now in the client side I have a method called

```
    getLinks()     

```

which invokes the same method on the server, the problem is that this method returns about 700Mb of data, which takes some time to get, and some more time to analyse.

And then I'm setting some values for each Link:

```
for (Link l : myService.getLinks()) l.setSelected(false);

```

What I have in mind right now is just getting the Link Ids first (since this would be a smaller data) and then using Asynchronous method to get each Link by Id (each link need one service call); and then setting the Link values.

Is this the best approach, is there another way of getting RMI data one by one (one method call and more than one return)?

Is there something like (yield return) in C#?