You are not logged in.
Pages: 1
Let's say we have a 2000 callback listeners working on different network segments - some of them uses slow connections such as mobile 3G.
So in this situation:
procedure TChatService.BlaBla(const pseudo,msg: string);
var i: integer;
begin
for i := high(fConnected) downto 0 do
try
fConnected[i].NotifyBlaBla(pseudo,msg);
except
InterfaceArrayDelete(fConnected,i);
end;
end;
1. the loop speed will depend on client network speed and 2.freeze the main thread if I execute BlaBla from timer placed on Main Form. 3.The last client from fConnected array will wait very long time waiting for all previous notifications of that queue. 4.The solution is for example the thread pool for "notifictions worker" so it allows asynchronous notifications.
AB, can you answer for all 4 questions? Maybe NotifyBlaBla is already async?
Last edited by radexpol (2020-11-23 06:58:42)
Offline
Pages: 1