Completely new to python. I wanna write a simple async function that does a ps $pid every N seconds until it receives a stop signal.i.e in go it'd simply be:
go func(cancelCtx context.Context) { ticker, cancel := time.NewTicker(time.Second) defer cancel() looper: for { select { case <-ticker.C: checkProcess() case <-ctx.Done(): break looper } } fmt.Println("exited")}(ctx)I'm slowly ramping up on python asyncio but hoping to at least get some general guidance on the best pythonic approach. Thanks.