Publish-Subscribe Messaging

Having written my thoughts on the subject in What's everyone building?, it seemed a shame not to just write the code!

Here’s my first attempt at a pub-sub implementation for Anvil apps:

8 Likes

That library is now updated to add an ‘unsubscribe’ method.

(And, yes, I did get bitten by the warning in the README about why you might need to unsubscribe)!

1 Like

Did you end up implementing something that would allow this functionality you described in your original post?

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…

I’m pretty excited: I think this, together with your ORM, is going to make an app I have been building much simpler and more maintainable.

No, I haven’t had time to get that done, I’m afraid.

1 Like

v0.1.3 released with new close_channel method on the publisher.

2 Likes

v0.1.4 released.

2 Likes