/// <summary> /// Call this function from within the functional agent /// to exit. /// </summary> /// <returns>true on success</returns> public bool Close() { IsClosing = true; CloseEvent.Set(); return(true); }