keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
urbank 2017-08-14T11:50:42.490164Z

@mihaelkonjevic Is it possible for a component to dispatch actions to multiple controllers?

mihaelkonjevic 2017-08-14T11:51:01.495755Z

you mean multiple controllers?

urbank 2017-08-14T11:51:19.500527Z

Oh, yeah, that

mihaelkonjevic 2017-08-14T11:51:29.503142Z

not out of the box

mihaelkonjevic 2017-08-14T11:51:50.508709Z

there was only one occasion where I had a need for that

mihaelkonjevic 2017-08-14T11:52:37.521470Z

and it was a very extreme corner case

mihaelkonjevic 2017-08-14T11:53:00.527492Z

you can either relay it from a controller (with send-command)

mihaelkonjevic 2017-08-14T11:53:21.533282Z

or you can hook into the channel that’s used for commands and do it from there

mihaelkonjevic 2017-08-14T11:54:01.543934Z

here’s an example of the second case:

urbank 2017-08-14T11:55:44.572771Z

Ok cool. Thanks for the example! I don't actually need it right now, it just came to mind when I saw that :topic was assoc-ed directly on the component as a keyword.

mihaelkonjevic 2017-08-14T11:56:17.582301Z

yes, and I’ve spent a lot of time thinking about it (especially after writing the example I just posted)

mihaelkonjevic 2017-08-14T11:56:40.588606Z

the reason why a component can talk only to one controller is because you can swap the topic from the outside

mihaelkonjevic 2017-08-14T11:56:55.592756Z

if the controller could add a topic when sending a command

mihaelkonjevic 2017-08-14T11:57:05.595580Z

that would couple that component and the controller

mihaelkonjevic 2017-08-14T11:57:25.601237Z

and as I said, it is a very rare occasion

mihaelkonjevic 2017-08-14T11:57:30.602587Z

(at least in my case)

mihaelkonjevic 2017-08-14T11:57:47.607674Z

if I had a system where that was needed in more than one place

mihaelkonjevic 2017-08-14T11:57:59.610922Z

I’d probably write a “relay” controller which would take care of that

urbank 2017-08-14T11:58:53.626016Z

Yeah, a relay controller actually sounds quite elegant.

urbank 2017-08-14T12:00:56.665058Z

So a controller which receives component commands and sends them out to the relevant controllers?

mihaelkonjevic 2017-08-14T12:01:42.679082Z

yes