Comments (15)
Sender consumers? That would fit with your definition of the third category, since you specifically used the word "consume".
from stdexec.
Do we have equivalents of these names in the ranges space? We should try to be consistent with that.
from stdexec.
What things are we talking about here for the third category? sync_wait? If we have a bunch of examples of these sender launchers, we might have a better chance of coming up with a name for them.
from stdexec.
Do we have equivalents of these names in the ranges space?
In ranges these terminal operations are called "actions" - maybe we can reuse this term for senders?
If we have a bunch of examples of these sender launchers, we might have a better chance of coming up with a name for them.
Some examples I can think of:
sync_wait(sender)
async_scope::spawn(sender)
- connect/start the operation which can be later joined using theasync_scope
objectsubmit(sender, receiver)
Other categories of function for a sender might be things that translate a sender into a different category of things:
- something that adapts a sender into a hypothetical async_range.
e.g.async_range single(sender auto s)
orasync_range repeat(sender auto s)
- something that adapts a sender into a
std::future
e.g.auto to_future(sender auto s) -> std::future<sender_single_value_t<delctype(s)>>
Would both of these also be "actions"?
Or that adapt other categories of things into senders:
- something that takes a hypothetical
async_range
and returns asender
.
e.g.sender first(async_range auto src)
orsender reduce(async_range auto src, auto initialState, auto reduction)
Would these be "sender factories"?
A "sender adapter" to me is something that I can curry other parameters into and produce a callable that takes as input a sender and returns a sender. An adapter has a kind of "primary" input sender that it operates on even if it also accepts other senders. Adapters are the kinds of things that generally fit well into a pipeable syntax.
I'm not sure that the when_all()
algorithm would fall into the "sender adapter" categorisation as it doesn't really have a "primary sender", though. Whereas an algorithm like stop_when(sender auto src, sender auto trigger)
would fall into this categorisation as the src
can be thought of as the primary input and the trigger
as an additional parameter.
I tend to think of the overarching umbrella of functions that operate on senders for which there is a default implementation as all being collectively called "sender algorithms".
Customisable functions for which there is no default implementation I have been calling "basis functions", possibly prefixed with the concept name for which these basis functions generally apply to.
from stdexec.
Is "consuming" the sender in some fashion an important characteristic of the operations in this third category that needs a name? Would we consider pure query functions like get_completion_scheduler
to be in or out of this category?
from stdexec.
Is "consuming" the sender in some fashion an important characteristic of the operations in this third category that needs a name? Would we consider pure query functions like
get_completion_scheduler
to be in or out of this category?
Yes, I think I would like to have terminology that distinguishes between queries on a sender and something that consumes/launches that sender.
from stdexec.
My suggestion:
"Sink" as the name for things that take senders but don't return them.
"Operation" as the collective name for sender factories, adaptors, and sinks.
from stdexec.
@griwes points out that "operation" already has a broader meaning that encompasses queries, like get_completion_scheduler
as well. get_completion_scheduler
is not what we currently call a "sender algorithm" because it never consumes the input.
It may be fine to have one term for all four of these things, so "operation" may be okay. We can't think of a time when accidentally including the queries would be a problem.
from stdexec.
Upon further discussion, we decided that we should just call get_completion_scheduler
a query, and use "operation" for "sender factory, sender adapter, or sender thing-that-takes-senders-but-doesnt-return-one".
from stdexec.
@griwes suggests "sender consumer" instead of "sender sink". That seems fine to me.
from stdexec.
"query": Function-like thing (usually a CPO) but doesn't modify its subject.
"operation": Function-like thing (usually a CPO)
"sender operation": one of "sender factory", "sender adapter", "sender consumer".
"sender factory": Doesn't take any senders, returns a sender.
"sender adapter": Takes senders, returns a sender that depends on them.
"sender consumer": Takes senders and connects to it.
from stdexec.
See #85
from stdexec.
@lewissbaker points out that "operation" is already used to refer to the thing that a sender does, e..g operation_state
. We'll need another word for this.
from stdexec.
I think the best option for the time being is to keep "sender algorithm" (the term referring to "sender factory", "sender adapter", and "sender consumer") and rename the second meaning of "sender algorithm" to "sender consumer".
So:
"query": Function-like thing (usually a CPO) but doesn't modify its subject.
"algorithm": Function-like thing (usually a CPO)
"sender algorithm": one of "sender factory", "sender adapter", "sender consumer".
"sender factory": Doesn't take any senders, returns a sender.
"sender adapter": Takes senders, returns a sender that depends on them.
"sender consumer": Takes senders and connects to it.
"Algorithm" is still a problem, because it has a dual meaning - there's also the sequence algorithms in <algorithm>
. It may be fine, though, if we judiciously distinguish between "sender algorithms" and "sequence" algorithms.
from stdexec.
Long term, I wonder if we can rename "operation state" to something else.
from stdexec.
Related Issues (20)
- repeat_n CPU implementation requested HOT 2
- is latest sync_wait() broken? HOT 5
- `just` senders are move/copy constructible but not assignable
- Trivial `sync_wait(just|then)` asserts HOT 3
- when_any question HOT 8
- replace the lock in `exec::__nest_rcvr::__complete` with a CAS loop
- gcc TSAN failure in `tbb_thread_pool`: "data race on vptr" in `task` ctor HOT 6
- make `nvexec::repeat_n` in maxwell example a customization of `exec::repeat_n`
- async_scope set_error calls std::terminate and exception is lost HOT 3
- stdexec doesn't compile on GCC 14 HOT 1
- nested `let_value`s confundles the result domain computation
- MSAN error in repeat_n HOT 6
- io_uring_context tests fail on some systems that don't allow io_uring system calls HOT 1
- Improve bulk implementation for static_thread_pool
- `static_thread_pool` causing long compile times
- Can not destructure a sender with multiple value
- stdexec and P3109 HOT 1
- How to achieve execution agent local variable? HOT 2
- reimplement compile-failed test support in pure cmake
- `io_uring_scheduler` can `throw` in `noexcept` functions causing termination
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stdexec.