Closed tipa closed 8 years ago
Your example is good. Generally speaking, the default HttpProvider
included in Graph.Core is safe for multiple requests at once. You can inspect the source here. Let me know if you run into any specific issues.
One other comment, when you construct the OneDriveClient
object, be sure to explicitly pass in an instance of HttpProvider
. When sending many requests, this will skip creating and disposing many instances of the class needlessly.
Thanks a lot for the answer! Could you please point me to the source code where there is the HttpProvider
created repeatedly if none is passed in to the OneDriveClient
? I searched the source but wasn't successful finding it.
Ah, I was mistaken. In BaseClient the HttpProvider
is created in the default constructor. I had a different part of the code in mind (authentication). Sorry for the mistake!
TL;DR: It should be safe to pass null
to the OneDriveClient
constructor if you want the default HttpProvider
implementation.
Is the OneDriveClient safe to use for up-/downloading multiple objects at once (via multiple tasks) like in the example below? And is there any best-practice for up-/downloadng lots of files (at once/asap)?
[slight edits by @cmayer for readability]