[client] Add state handling cmdline options (#2821)

This commit is contained in:
Viktor Liu
2024-12-03 16:07:18 +01:00
committed by GitHub
parent 8866394eb6
commit e5d42bc963
7 changed files with 1237 additions and 173 deletions

View File

@ -338,6 +338,19 @@ func (c *ConnectClient) Engine() *Engine {
return e
}
// Status returns the current client status
func (c *ConnectClient) Status() StatusType {
if c == nil {
return StatusIdle
}
status, err := CtxGetState(c.ctx).Status()
if err != nil {
return StatusIdle
}
return status
}
func (c *ConnectClient) Stop() error {
if c == nil {
return nil