Relative Content

Tag Archive for rustrust-tokioi3

Run mutable function twice, once in a loop, and once on SIGUSR1

I’m trying to write a status generator for I3, and for updating the volume indicator it requires that the program can handle SIGUSR1 requests to update the bar. I already run the generation function in a loop every 1 sec and just need to handle those requests. I’m using Tokio for the project since it can handle requests like that out of the box. My code (tell me if you need more context):