I have the following code:
Code: Select all
async method _Connect( cHostName as string, cUserName as string, cPassword as string ) as Task<logic>
local lReturn as logic
local oTask as Task
_oClient := AsyncFtpClient{ cHostName, cUserName, cPassword }
oTask := _oClient:Connect()
await oTask
lReturn := _oClient:IsConnected
return lReturn
If I understand that correctly, this method returns only when the task is finished.
But when I call that method from another one
Code: Select all
public method Connect( cHostName as string, cUserName as string, cPassword as string ) as logic
local lReturn as logic
self:_Connect( cHostName, cUserName, cPassword )
lReturn := _oClient:IsConnected
return lReturn
Code: Select all
warning XS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
Thank you very much!
Wolfgang