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

Any suggestion for StreamingHubContext in 7.0.0? #905

Open
siberhecy opened this issue Feb 1, 2025 · 0 comments
Open

Any suggestion for StreamingHubContext in 7.0.0? #905

siberhecy opened this issue Feb 1, 2025 · 0 comments

Comments

@siberhecy
Copy link

I'm currently using 6.1.6 version, I saw 7.0.0 update and wanted to upgrade but I see "StreamingHubContext is now reused
StreamingHubContext is now reused, so caching StreamingHubContext outside of Hub method calls may result in unexpected behavior. The context is only valid during the call." change.
I'm used to cache IChatHub. Since IChatHub contains StreamingHubContext does this change affect me?
If yes, what solution you suggest? Thanks.

Example;

public class ClientData : IClientData
{
    public AccountInfo AccountInfo { get; set; }
    public IChatHub ChatHub { get; set; }

    public ClientData(AccountInfo accountInfo)
    {
        AccountInfo = accountInfo;
    }
}

public class ClientManager {
    private readonly ConcurrentDictionary<int, ClientData> _loggedClients = new ConcurrentDictionary<int, ClientData>();
}
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

No branches or pull requests

1 participant