I have 3 identical HTTP servers, holding the same data:
I want to query this data as reliable and quick as possible. In Java, I would have done this by spawning 3 threads -- each requesting one of my servers, and used the response that I got first (only waiting for the single fastest reply).
Can something similar be done efficiently in Apex (for example with
@future methods)? There are two things that makes me worried that it won't be efficient:
The docs says that "Each future method is queued and executes when system resources become available". This implies that it's slower than regular methods.
@futuremethods has to return
void, I have to write the result to the database(?) and setup some trigger logic that detects when the first response has arrived(?). This sounds slower than regular methods as well.
Am I right in my assumptions?