Create async service on server

delphi
async

(Yiannis Tsakiridis) #1

Hello,

Usually whenever i want to create a service instance i use something like

procedure TServerDataModule.isCreateLogService;
Var
  isLF: IROClassFactory;
  AInt: IInterface;
begin
  isLF:= GetClassFactory(LogService_Impl.__ServiceName);
  If Assigned(isLF) Then Begin
    isLF.CreateInstance(EmptyGUID, AInt);
    FisLogService:= AInt As ILogService_Async;
  End;
end;

now that my service is async how do i create it, since the previous snippet does not work

Thank you


(EvgenyK) #2

Hi,

you can’t cast AInt As ILogService_Async because your service only support ILogService.
_Async/_AsyncEx interfaces are available for client-side only.

if you want to have async access, you can create usual service and call methods from background thread