Back to EIP
Message Dispatcher
⋯
service / on new http:Listener(8080) {
int processorNo = 0;
isolated resource function get ocr(string url) returns OcrResponse|error {
int currentProcessor;
lock {
currentProcessor = self.processorNo;
self.processorNo = currentProcessor == 2 ? 0 : currentProcessor + 1;
}
string processorId = ocrProcessors[currentProcessor];
return check ocrClient->/[processorId]/parse/imageurl(url = url);
}
}