I would love to see a publish and subscribe system in the engine for use in Standalone.

I've written a LCS library for for publish and subscribe within our commercial apps, but would toss it in an instant for a good engine implementation.

Beyond abstracted commands like:
revIDESubscribe "helloworld" -> subscribe <messageName>
ideMessageSendWithParameters "helloworld" -> publish <messageName> with <parameters>, which could just be existing "send" or "dispatch"

You need a general suppress messages/unsuppress messages, which we have as "lock messages" and "unlock messages" already in the language.

You also need an "unsubscribe <messageName>" and a "lock <messageName> messages [for <object>]" / "unlock <messageName> messages [for <object>]" to allow suppression/unsuppression of a specific message for all objects or for specific object.

We already have "the pendingMessages" and "cancel", but you would also want to add "the subscribers [of <messageName>]" for a list of long IDs of objects and their messages or filtered for a specific message subscribed to and "the publishers [of <messageName>]" for a similar list of object IDs when the messages they publish or filtered for a specific message.

Or perhaps I have been thinking too much about this!


On 10/2/2019 8:58 AM, Tom Glod via use-livecode wrote:
thats what i'm thiking about..its only documented in the "create a plugin"
sections.  But having this in standalones would be a bit of news.

So every message the engine sends is checked to see if there is a
subscription to that message and then all objects ( whether in the path or
not. ) that are subscribed would receive a message that this message was
triggered. That is pretty cool!

On Wed, Oct 2, 2019 at 8:53 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

On 10/1/2019 11:52 PM, Mark Wieder via use-livecode wrote:
I have finally gotten around to noticing that LC9.x builds have opened
the publish-and-subscribe mechanism to arbitrary messages. I'm not
sure when this happened and I'm really not inclined to go searching
through all those release notes, but I'm ecstatic over the surprise
discovery. This means objects can register interest in certain
messages to do something like

object1:
revIDESubscribe "helloworld"

object2:
revIDESubscribe "helloworld"

object3:
ideMessageSendWithParameters "helloworld"

and both object1 and object2 will get notifications, fully
implementing the Publish-and-Subscribe design pattern.

Thank you team.

Have you tested this is a standalone?

I thought (probably incorrectly) that revIDE... functions/commands were
only available when running in the IDE?


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to