MCPcopy Create free account
hub / github.com/comaps/comaps / DownloadAsync

Method DownloadAsync

libs/platform/remote_file.cpp:73–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void RemoteFile::DownloadAsync(std::string const & filePath, StartDownloadingHandler && startDownloadingHandler,
74 ResultHandler && resultHandler) const
75{
76 RemoteFile remoteFile = *this;
77 GetPlatform().RunTask(Platform::Thread::Network, [filePath, remoteFile = std::move(remoteFile),
78 startDownloadingHandler = std::move(startDownloadingHandler),
79 resultHandler = std::move(resultHandler)]
80 {
81 if (startDownloadingHandler)
82 startDownloadingHandler(filePath);
83 auto result = remoteFile.Download(filePath);
84 if (resultHandler)
85 resultHandler(std::move(result), filePath);
86 });
87}
88} // namespace platform

Callers

nothing calls this directly

Calls 2

RunTaskMethod · 0.80
DownloadMethod · 0.45

Tested by

no test coverage detected