itzg / mc-router

Routes Minecraft client connections to backend servers based upon the requested server address

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could a --routes-refresh parameter be implemented?

Codrax opened this issue · comments

I would like to run around 10 servers simultaneously, and currently, to add/remove a server I need to change the config.json. And the proxy need to be closed and re-opened to index the changes.

With a --routes-refresh parameter, optionally taking a second input for how often to refresh the routes, the application could compare the last stored modification date of the file provided with --routes-config.

This would allow the server list to be updated gracefully without restarting all servers.

Thank you!

That's a great idea!

@Codrax with this library it looks like I could have it watch for file changes. Would that be even better or still prefer/recommend a timer based approach?

@Codrax with this library it looks like I could have it watch for file changes. Would that be even better or still prefer/recommend a timer based approach?

Both cases would be great as long as the file reloads. I don't know a lot about that library, but I'm pretty sure the timer based approach is simpler as that just utilises the CPUs task scheduler, which I think is more optimised. But both options are valid.

at lest for the fsnotify backend for linux the CPU over head is very little

at lest for the fsnotify backend for linux the CPU over head is very little

Right. It's driven by existing filesystem OS events, so there's virtually no extra overhead.