PubSub broadcast example?

I’ve been reading this page about PubSub:

And there it says back-end services can use it to broadcast, but everything I see on that page seems to describe everything from a receiving message perspective. I don’t see any API methods for broadcasting. Is there a good sample anywhere?

I have an extension that lets broadcasters create quizzes for their viewers to play. Each viewer plays the quiz (takes the quiz) by interacting with my extension front-end panel. When the broadcaster ends the quiz, I need to broadcast the quiz results where everyone can see it.

How do I use PubSub to do this? Or is this kind of an “unsolicited” broadcast better suited for the IRC chat API using a TMI provided WebSocket By “unsolicited” I mean that the broadcast from my extension is not the result of an action occurring on a topic my extension is listening to (i.e. - subscribed to), but instead, is triggered as a result of the broadcaster pressing the button in the Live Config panel that ends the quiz,

You’ve linked to the PubSub docs that deal with channel information, you need the Extension PubSub does which are under extensions.

It’s not “unsolicited”, it’s a core component to some extensions.

PubSub lets you send a message to your extension, without having to build and support your own sending mechanism. And scale that mechanism.

1 Like

@BarryCarlyon Thanks again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.