facebookexperimental / facebookexperimental/libunifex

any_sender_of<> did not support stop_when sender

Open
#663 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

set_value cause template argument deduction/substitution failing

```C++
#include
#include
#include
#include
#include
#include

int main() {
using AnySender = unifex::any_sender_of<>;

// Simulate the handler returning AnySender
auto handler_sender = AnySender{unifex::just()};

// Timeout duration
std::chrono::seconds timeout(5);

// This line causes compilation failure:
// The issue is that schedule_after requires a scheduler context,
// but we're trying to use it directly without a scheduler instance
auto timeout_sender = std::move(handler_sender)
| unifex::stop_when(unifex::schedule_after(timeout));
/*
auto timeout_sender = std::move(handler_sender) // Success
*/

// Further processing with let_done
auto result_sender = std::move(timeout_sender)
| unifex::let_done([]() {
return AnySender{unifex::just()};
});

// Convert back to AnySender
AnySender final_result{std::move(result_sender)};

return 0;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.