TwitchLib / TwitchLib.PubSub

PubSub component of TwitchLib.
38 stars 52 forks source link

multi-tenancy support #37

Closed NickLarsen closed 7 months ago

NickLarsen commented 5 years ago

The api documentation says:

  • Clients can listen on up to 50 topics per connection. Trying to listen on more topics will result in an error message.
  • We recommend that a single client IP address establishes no more than 10 simultaneous connections.

I'm trying to write a web app for my stream team that will watch streams and provided functionality across the whole team. There are currently about 70 members of my team, of course they are not all streaming simultaneously. Once members of my team generate an account on my app, it will listen for StreamUp events and then subscribe to additional topics until it receives a StreamDown event at which point it will unlisten all topics except the video playback topic. At some point we might want to expand this to support more than just my team.

There are a number of concerns in the current implementation that need to be addressed to support this:

I think the rest can be handled by the app code although one additional nice to have would be each connection tracking which topics it is actively subscribed to since that is going to be a concern of every multi-tenancy app. This is what I can see on the surface although more stuff might pop up as I work through the details.

swiftyspiffy commented 4 years ago

Hi @NickLarsen . So sorry I'm just seeing this now :( . This is a great CR and and you're right, it addresses several problems with the current implementation. It it's a bit out of date, and I think it should target dev branch. When I get some time, I might fix this CR up and push it in, if you don't mind.

NickLarsen commented 4 years ago

@swiftyspiffy thanks, I really dropped the ball on this because I shifted focus to something else for a bit but I'm happy to jump back in if you want to pick it up