Reputation: 49
I was wondering if I have 2 kdb processes A and B, and I perform a synchronous call from A like so:
h(`function_defined_on_b; args);
A will hang until function_defined_on_b is executed. But what if function_defined_on_b requires a call to A? I assume it will fail to execute then as the call to A will timeout due to the fact that A is currently hanging. I know making an asynchronous call from A to B would fix this issue, but what should I do in the case where I don't want A to proceed with the code its running until this call is complete?
Alternatively is there any way to stop A from executing whatever code follows the synchronous call but allow it to execute incoming queries from other processes?
Thanks
Upvotes: 0
Views: 225
Reputation: 2800
There isn't really a way to do what you describe. A possible solution would be to have some kind of gateway/aggregator process to run functions which require data across multiple processes. Calling it C:
Function to run on C:
aggFunc:{
responseFromA:handleToA(`func;args);
//process A is free at this point to process the call from B.
//process C can then wait for this response before sending the next part to A
responseFromB:handleToB(`func;args);
responseFromA2:handleToA(`func2;args);
};
Upvotes: 1