Skip to content

Invalid promise behaviour #4

@korrix

Description

@korrix

Future callback is not invoked if promise gets resolved before it was hooked:

Promise<int> p;
p.resolve(5);
p.future().then([](auto a) {
  std::cout << "a: " << a << std::endl; // does not print anything
});

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