mount

Frederik 2018-03-14T09:23:44.000376Z

@tolitius is there another way to implement this and avoid duplication of the start and stop fn everywhere? As far as I understand the defstate macro, it must be executed inside the ns, not in a function, because that would create that state local to that function (wrong scope).

tolitius 2018-03-14T14:43:21.000496Z

@f.v.claus > is there another way to implement this and avoid duplication of the start and stop fn everywhere? can you elaborate of what it is you are trying to achieve? i.e. why would you have/need this duplication in the first place?

Frederik 2018-03-14T15:58:26.000524Z

@tolitius the macro above creates a state that handles a connection. The channel name and notify fns are different. Implementing one state instead of several require more development and testing effort than I am willing to invest right now.

tolitius 2018-03-14T16:13:57.000611Z

you mean you need to create several connections, one of each channel?

tolitius 2018-03-14T16:16:31.000346Z

depending on what it is you are doing if all of these connections created at the same time (when the app starts) and stop at the same time (when the app ends), you could have a function that takes all these channel names and creates all the connections at once, which could then be used as a :start function of a single state

tolitius 2018-03-14T16:17:33.000682Z

or you could have a connection pool like state that issues and releases connections