pusher / pusher-websocket-dotnet

Pusher Channels Client Library for .NET
MIT License
112 stars 113 forks source link

Adding alternative methods to avoid dynamic usage #77

Closed cdauphinee closed 4 years ago

cdauphinee commented 5 years ago

Looking for early feedback. I haven't plugged this in to fully test end-to-end yet.

The PresenceChannel change wasn't as easy as I had thought. I didn't want to store the member info as raw JSON, because it would force consumers to either repeatedly deserialize it or maintain their own cache, which isn't very friendly.

I ended up refactoring it into a generic, so the consumer can provide the model that they want to use for the member info. However, this doesn't play very well with the way channels are created, and having two different ways to subscribe to a presence channel is not ideal. It definitely introduces some ugliness. Let me know if you have any better ideas.

damdo commented 4 years ago

Hey @cdauphinee, thank you very much for the PR, we reviewed it internally and we think it looks good. Thanks again for your contribution.