procedure MyCallBack(const aRequest: IROAsyncRequest);
var
lData,sDir: String;
sLst:TStringList;
UpdatedBin:Binary;
begin
TxtLog.Send(‘Done Syn Request:’+IntToStr(Ord(aRequest.Cancelled)));
try
if (not aRequest.Cancelled) then
begin
UpdatedBin:= MySyn.EndGET_CM_KB(aRequest);
cdsSynList.RemoteFetchEnabled := False;
cdsSynList.LogicalName := ‘ASYN_VIEW’;
DABin2DataStreamer.ReadDataset(UpdatedBin,cdsSynList,True);
TxtLogSend(cdsSynList.Fields[0].AsString+’:’+cdsSynList.Fields[1].AsString);
end
Else
TxtLog.Send(‘Done Syn Request----Done:’+IntToStr(Ord(aRequest.Done)));
finally
if aRequest = myReq then myReq := nil;
end;
end;
The above method come out error on timeout and go to the callback function
Please advise what I m missing in order to run long running process.
this value should be great than time of execution of the longest method of server-side
by other way, you can replace it with two methods and event.
when client-side receives the specific event, it should call server-side method and get result of long method
Question regarding that example. When the StartLongMethod is invoked, it will be received on the server side on a new thread. Is it safe to assume than when you create a task and run it inside of this thread, the thread will continue its execution leaving the task running and doing the Event Sink after its done?
Would we have a memory leak on the server side while doing this?
what object should be leaked by your opinion? is service itself? it is interface so it will be destroyed when refcount = 0.
if you add fastmm4 into server-side project, it won’t generate any report about memory leaks so this code is safe.