integrant

_mthom 2018-08-01T14:42:08.000249Z

Hi everyone, I’m trying to use integrant’s suspend/resume functionality. I want to be able to pass a list of keys to resume to just resume those keys. But it seems that integrant is first halting all other keys. Am I reading the code correctly? And is there any way to avoid this behaviour?

2018-08-01T14:45:05.000060Z

The keys argument of resume is designed to match the keys argument of init. So in other words, a halt! then a init should result in the same running keys as a suspend! followed by a resume.

2018-08-01T14:46:35.000372Z

What exactly are you trying to do? Maybe there’s another solution for it.

_mthom 2018-08-01T14:51:28.000646Z

I have some parts of a system consuming messages from a queue. Is it possible to use suspend and resume somehow to stop and start just those processes that are reading from the queue? The problem is that I don’t want them to be running from the start - the processes should not start reading from the queue until they get a message from somewhere else.

_mthom 2018-08-01T14:51:35.000221Z

Does that make sense?

2018-08-01T14:53:17.000116Z

A little. So to clarify: you don’t want the keys to be running when the config is initiated, only when it’s resumed?

_mthom 2018-08-01T14:53:41.000013Z

Yes, that’s right

2018-08-01T14:55:02.000351Z

I think you need to put something else in place, as if I understand you correctly, that’s not what suspend/resume was designed for.

2018-08-01T14:55:25.000252Z

suspend!/resume is made to replace halt!/init when developing.

2018-08-01T14:56:13.000385Z

So semantically it has to produce the same thing, but suspend!/resume allows connections, threads and other temporary resources to be re-used.

_mthom 2018-08-01T14:56:43.000247Z

OK, I see. That makes sense, I will find another way to do it. Thanks for your help!

2018-08-01T14:56:50.000534Z

np