def METHOD_NAME(self, queue):
    cnt = 0
    run = None
    try:
        while True:
            wandb_task: WandBTask = queue.get()
            cnt += 1
            if wandb_task.task_type == "stop":
                self.log_info(self.fl_ctx, f"received request to stop at {wandb_task.task_owner} for run {run}")
                break
            elif wandb_task.task_type == "init":
                self.log_info(self.fl_ctx, f"received request to init at {wandb_task.task_owner}")
                run = wandb.init(**wandb_task.task_data)
            elif wandb_task.task_type == "log":
                if cnt % 500 == 0:
                    self.log_info(self.fl_ctx, f"process task : {wandb_task}, cnt = {cnt}")
                if wandb_task.step:
                    wandb.log(wandb_task.task_data, wandb_task.step)
                else:
                    wandb.log(wandb_task.task_data)
    finally:
        if run:
            run.finish()