friendsofgo / killgrave

Simple way to generate mock servers written in Go

Home Page:https://friendsofgo.github.io/killgrave/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add functionality for command execution/ run servers as cancellable services

AlvinKuruvilla opened this issue · comments

This a really awesome project
I think it would be cool if the servers were able to run commands and then destroy the mocks
Similar to
https://github.com/jonhoo/minion and https://github.com/jonhoo/tsunami (except not for AWS)

I also have a go package for graceful shutdown of cancellable services (if adding this functionality is something that could be good for this project....

Hey @AlvinKuruvilla,
Thanks for reaching. I'm glad to see community contributions and ideas.

Just to be sure I understood you correctly,
Do you mean something like capturing the Interrupt Signal then calling the http.Server.Shutdown method to perform a graceful shutdown? Or by cancellable service do you mean something different?

Thanks!

The Interrupt Signal could work, but the way I designed the library is just through CTRL + C and then the servers are gracefully shutdown. To be honest, the Interrupt signal could work better, but I don't know how to exactly send such a signal and have the servers listen for it

In terms of command execution, I have tried implementing it in my library with exec, but It doesn't seem to work

I'm so sorry but we cannot understand what you're trying to achieve because the Killgrave app already listens to interruption signals from the operative system in order to shut down the mock server.

Can you bring some additional context or share further details about your specific use case, please? Thanks!

No don't apologize, I see that killgrave is achieving something else than I was thinking. I was picturing it somewhat like a cancellable server that can execute commands using exec. But, I don't think that's what you are trying to achieve with the project