[question] how do we `bulk` a batch of `senders` ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
No source files or tests are named. Start by reading the existing bulk, when_all, and sync_wait documentation and entry points to determine how sender-returning operations are composed; done means documenting whether the requested behavior is already supported or defining a scoped API/design issue if it is not.
Written by the indexing model from the issue text.
Description
Suppose we have an async operation:
stdexec::sender auto tcp::socket::async_connect(endpoint);
Now we try to connect a batch of endpoints, and wait for all/any of them.
stdexec::sender auto task_1 = socket_1.async_connect("127.0.0.1:1");
stdexec::sender auto task_2 = socket_2.async_connect("127.0.0.1:2");
stdexec::sender auto task_3 = socket_3.async_connect("127.0.0.1:3");
/* ... */
stdexec::sender auto task_65535 = socket_65535.async_connect("127.0.0.1:65535");
stdexec::sync_wait(stdexec::when_all(task_1, task_2, task_3, /*...*/, task_65535));
The functions above are all senders instead of synchronous functions (that is, submit task and later callback). Although we can bulk synchronous functions using stdexec::bulk(policy, shape, sync_func), I wonder: is there a function that we can stdexec::/*bulk_what*/(policy, shape, func_who_returns_sender)? I tried hard to read the docs but sadly could not find it.
auto sockets = std::vector<tcp::socket>(65535);
stdexec::sync_wait(stdexec::/*let_bulk_or_some_name_else?*/(
stdexec::par,
65535,
[&] { return sockets[i].async_connect(std::format("127.0.0.1:{}", i); }
)
Thank you!
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 270
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/stdexec
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·