def METHOD_NAME(self, env: Environment) -> None:
    callback_id = env.context_object_manager.context_object["Task"]["Token"]
    callback_endpoint = env.callback_pool_manager.get(callback_id)
    # With Timeouts-only definition:
    if not self.heartbeat:
        self.timeout.eval(env=env)
        timeout_seconds = env.stack.pop()
        # Although the timeout is handled already be the superclass (ExecutionState),
        # the timeout value is specified here too, to allow this child process to terminate earlier even if
        # discarded by the main process.
        # Note: although this is the same timeout value, this can only decay strictly after the first timeout
        #       started as it is invoked strictly later.
        outcome = callback_endpoint.wait(timeout=timeout_seconds)
    else:
        self.heartbeat.eval(env=env)
        heartbeat_seconds = env.stack.pop()
        heartbeat_endpoint: HeartbeatEndpoint = callback_endpoint.setup_heartbeat_endpoint(
            heartbeat_seconds=heartbeat_seconds
        )
        outcome = None
        while (
            env.is_running() and outcome is None
        ):  # Until subprocess hasn't timed out or result wasn't received.
            received = heartbeat_endpoint.clear_and_wait()
            if not received and env.is_running():  # Heartbeat timed out.
                raise HeartbeatTimeoutError()
            outcome = callback_endpoint.get_outcome()
    if outcome is None:
        raise CallbackTimeoutError()
    if isinstance(outcome, CallbackOutcomeSuccess):
        outcome_output = json.loads(outcome.output)
        env.stack.append(outcome_output)
    elif isinstance(outcome, CallbackOutcomeFailure):
        raise CallbackOutcomeFailureError(callback_outcome_failure=outcome)
    else:
        raise NotImplementedError(f"Unsupported CallbackOutcome type '{type(outcome)}'.")