Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Func<Stream, Task> to replace Action<Stream> for GetObjectAsync() #730

Merged
merged 2 commits into from
Jan 7, 2023

Conversation

ebozduman
Copy link
Collaborator

Fixes #420

Adds Func<Stream, Task> to replace Action to run GetObjectAsync with async callback.

This also fixes the disposed object exception

Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'SslStream'.
   at System.Net.Security.SslStream.<ThrowIfExceptional>g__ThrowExceptional|138_0(ExceptionDispatchInfo e)
   at System.Net.Security.SslStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.FillAsync(Boolean async)
   at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
   at Minio.MinioClient.<>c__DisplayClass111_0.<<getObjectFileAsync>b__0>d.MoveNext() in /home/ersan/work/src/github.com/minio/minio-dotnet/Minio/Helper/OperationsHelper.cs:line 112
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

@harshavardhana harshavardhana merged commit afa9dad into minio:master Jan 7, 2023
Urantij added a commit to Urantij/minio-dotnet that referenced this pull request Mar 2, 2023
* using interface IReadOnlyDictionary instead of a dicrionary in TagSet and Tagging

* Adds Func<Stream, Task> to replace Action<Stream> for GetObjectAsync() (minio#730)

* Update version to next release 4.0.8

* Replaces 'http' with 'https' in Minio.Tests for 'play.min.io'

* Removes unnecessary port number

---------

Co-authored-by: Алексей Даниленко <a-danilenko@insoc.ru>
Co-authored-by: ebozduman <ersan.bozduman@gmail.com>
Co-authored-by: Minio Trusted <trusted@minio.io>
Urantij pushed a commit to Urantij/minio-dotnet that referenced this pull request Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asynchronously processing GetObjectAsync stream
2 participants