What's everyone building?

I also have one in my head that will make it into actual code at some point…

I’d like to implement a pub/sub model with a Publisher class that has ‘publish’ and ‘subscribe’ methods.

Any form could then publish messages (probably to a 'channel ’ on the Publisher) and could also subscribe to those channels with a handler for processing the incoming messages.

Messages would have content that could be any object - simple strings, events, whatever. The subscription handlers in each form would choose what’s of interest and how to react.

In my head, I’m also thinking of making Publisher a portable class so a copy could reside on the server, probably in the session. The client side could then poll its server side sibling for messages at regular intervals and publish them to subscribers.

Possibly just the messages would be portable and the publishers separate. Not sure yet.

Still thinking this one through…

2 Likes