-
Notifications
You must be signed in to change notification settings - Fork 359
Clone CreateResponseOptions #904
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -632,7 +632,7 @@ public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(st | |
| internal virtual CreateResponseOptions CreatePerCallOptions(CreateResponseOptions userProvidedOptions) | ||
| { | ||
| CreateResponseOptions clonedOptions = userProvidedOptions is null | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider doing a thread-static shared instance for default options rather than creating an instance per-call?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What scenario did you have in mind where we'd use the default options? My assumption is that we'll typically only clone when someone is passing in a non-default options instance.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're doing a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, makes sense. For some reason I thought this comment was on the clone method. |
||
| ? new() | ||
| ? CreateResponseOptions.Default | ||
| : userProvidedOptions.Clone(); | ||
|
|
||
| // If the model is null, use the default specified in the client. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work without being
[ThreadStatic]? Won't we end up with concurrency issues because of the mutation during operations?