Closed TheToor closed 1 week ago
@TheToor, you can currently use Task<BulkExportResponse> GetExportStatus(string token)
and Task<BulkImportResponse> GetImportStatus(string token)
to build your own methods as they return the current state of the import or export.
I went for the "And alternative", the AwaitImport/Export have been updated, supporting both.
Task<Stream> AwaitDownload(string token, int pollingIntervalInSeconds)
Task<Stream> AwaitDownload(string token, int pollingIntervalInSeconds, CancellationToken cancellationToken)
Task<Stream> AwaitDownload(string token, int pollingIntervalInSeconds, int timeoutInSeconds)
Task AwaitDownloadAndSave(string token, int pollingIntervalInSeconds, string path)
Task AwaitDownloadAndSave(string token, int pollingIntervalInSeconds, string path, CancellationToken cancellationToken)
Task AwaitDownloadAndSave(string token, int pollingIntervalInSeconds, string path, int timeoutInSeconds)
Task<BulkImportResponse> AwaitImport(string token, int pollingIntervalInSeconds)
Task<BulkImportResponse> AwaitImport(string token, int pollingIntervalInSeconds, CancellationToken cancellationToken)
Task<BulkImportResponse> AwaitImport(string token, int pollingIntervalInSeconds, int timeoutInSeconds)
Perfect :) Maybe you can change the int to TimeSpan instead do more adhere to current standards? Having a cancellation token for potentially long running operations is just good design I think. No matter if we can build our own methods. But to be fair I didn't check that I can build my own loop :)
Agree with the TimeSpan
, I will update the code later this week and replace int timeoutInSeconds
with a TimeSpan timeout
.
@TheToor, thanks for the feedback, I have updated to code, changed int timeoutInSeconds
to TimeSpan timeout
.
Closing this enhancement as this was implemented and released two week ago.
Imports may take a long time. I want the ability to have it timeout after it takes to long. I think the easiest way would be for the AwaitImport/Export Methods to accept a cancellation token to stop the polling. And/or alternative would be a timeout parameter for the method to time out and return an TimeoutException.