Skip to content

Expose public initializer for HttpConnectionOptions #76

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

Merged
merged 1 commit into from
May 5, 2025

Conversation

yannisalexiou
Copy link
Contributor

@yannisalexiou yannisalexiou commented May 2, 2025

🔧 Summary

This PR adds a public init() to the HttpConnectionOptions struct, enabling external consumers to create and customize instances outside the module.


Problem

Currently, HttpConnectionOptions is a public struct with several public properties, including accessTokenFactory. However, it lacks a public initializer, making it impossible to construct an instance from outside the module.

This prevents developers from using methods like:

HubConnectionBuilder()
    .withUrl(url: "https://example.com", options: customOptions)

Related Issue

This fix is related to #65 and especially the last comment from @mikheil-natsvlishvili
#65 (comment)
A full explanation of this issue can be found here #77

@bjqian bjqian merged commit cb303c1 into dotnet:dev May 5, 2025
3 checks passed
@yannisalexiou
Copy link
Contributor Author

@bjqian could you please also release a version with this change?

bjqian added a commit that referenced this pull request May 6, 2025
* Add action for dev (#72)

* Add message buffer (#73)

* Add message buffer

* Some improvement

* Improve again

* Add client to server stream (#74)

* Add client to server stream

* increase timeout

* Add public initializer to HttpConnectionOptions to allow external instantiation (#76)

* hide stateful reconnect, prepare release for 1.0.0-preview.4 (#78)

* Hide stateful reconnect options

* Add public init for MsgpackTimestamp

* Release 1.0.0-preview.4

* Update readme

---------

Co-authored-by: Chenyang Liu <zackliu1995@hotmail.com>
Co-authored-by: Yannis Alexiou <yannisalexiou@users.noreply.github.com>
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.

2 participants