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

Support for request kwargs in object.jl #31

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Support for request kwargs in object.jl #31

merged 1 commit into from
Jan 30, 2023

Conversation

Drvi
Copy link
Member

@Drvi Drvi commented Jan 30, 2023

No description provided.

@Drvi Drvi requested a review from quinnj January 30, 2023 13:16
@@ -177,7 +178,7 @@ mutable struct PrefetchedDownloadStream{T <: Object} <: IO
prefetch_multipart_size > 0 || throw(ArgumentError("`prefetch_multipart_size` must be positive, got $prefetch_multipart_size"))
if size > 0
for _ in 1:min(Threads.nthreads(), max(1, div(size, io.prefetch_multipart_size)))
Threads.@spawn _download_task($io)
Threads.@spawn _download_task($io; $kw...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do a quick local check to make sure this works? My gut says I don't know if it should be ($io; $(kw...)) or what you have here, but maybe it doesn't make a difference. Can you just double check by printing keyword args in CloudBase or HTTP to make sure things are getting passed through correctly? I'd hate to update things and then discover later that specific tasks weren't getting keywords passed through right.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't sure as well so I made this little experiment:

x = [1,2,3]
for _ in 1:5 # works
    Threads.@spawn println($x...)
end

for _ in 1:5 # error
    Threads.@spawn println($(x...))
end

for _ in 1:5 # works
    Threads.@spawn println($(x)...)
end

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one question; once answered, feel free to merge and tag!

@Drvi Drvi merged commit ee574fe into main Jan 30, 2023
@Drvi Drvi deleted the td-streaming-kwargs branch January 30, 2023 16:02
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.

None yet

2 participants