Skip to content

Is callback mode required if there's no callback? #556

Open

Description

@kainino0x

Callback modes default to 0 which is invalid (btw, we should explain this).
But is 0 valid if there's no callback to apply the mode to? (the callback pointer is nullptr)
Also, do we allow callbacks to be nullptr in all cases?

Activity

  1. lokokung commented on Aug 25, 2025

    @lokokung
    Collaborator

    So in my opinion, nullptr callbacks don't make too much sense especially since, IIRC, all the callbacks have a status that kind of needs to be checked to understand whether the async call succeeded. Naively, I was thinking that it could be useful for something like WaitAny(OnSubmittedWorkDone()), but the issue is that if, for example, there was a validation error on that call, the user might expect that the work is done when in reality it wasn't. For many of the other callbacks, it makes even less sense to have a nullptr callback since the actual result is only obtained via the callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions