diff --git a/api/client.go b/api/client.go index afb902a2d0ab8f97c5823074bef39fc9d167c17a..1a3840abe3373037673538fc402cfeff24e1aded 100644 --- a/api/client.go +++ b/api/client.go @@ -526,6 +526,12 @@ func (c *Client) NetworkFollowerStatus() Status { return c.followerServices.status() } +// HasRunningProcessies checks if any background threads are running +// and returns true if one or more are +func (c *Client) HasRunningProcessies() bool { + return c.followerServices.stoppable.IsStopped() +} + // Returns the health tracker for registration and polling func (c *Client) GetHealth() interfaces.HealthTracker { jww.INFO.Printf("GetHealth()") diff --git a/bindings/client.go b/bindings/client.go index 9f2c1b3005211e9b6996fcbb14dac9909e2a7870..47e4b34a34943c09a740eaec61ef9c6f26965538 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -265,6 +265,15 @@ func (c *Client) WaitForNetwork(timeoutMS int) bool { func (c *Client) NetworkFollowerStatus() int { return int(c.api.NetworkFollowerStatus()) } +// HasRunningProcessies checks if any background threads are running. +// returns true if none are running. This is meant to be +// used when NetworkFollowerStatus() returns Stopping. +// Due to the handling of comms on iOS, where the OS can +// block indefiently, it may not enter the stopped +// state apropreatly. This can be used instead. +func (c *Client) HasRunningProcessies() bool { + return c.api.HasRunningProcessies() +} // returns true if the network is read to be in a healthy state where // messages can be sent