GithubHelp home page GithubHelp logo

Comments (15)

mjgarland avatar mjgarland commented on June 17, 2024

Sender consumers? That would fit with your definition of the third category, since you specifically used the word "consume".

from stdexec.

LeeHowes avatar LeeHowes commented on June 17, 2024

Do we have equivalents of these names in the ranges space? We should try to be consistent with that.

from stdexec.

villevoutilainen avatar villevoutilainen commented on June 17, 2024

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.

lewissbaker avatar lewissbaker commented on June 17, 2024

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 the async_scope object
  • submit(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) or async_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 a sender.
    e.g. sender first(async_range auto src) or sender 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.

mjgarland avatar mjgarland commented on June 17, 2024

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.

lewissbaker avatar lewissbaker commented on June 17, 2024

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.

brycelelbach avatar brycelelbach commented on June 17, 2024

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.

brycelelbach avatar brycelelbach commented on June 17, 2024

@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.

brycelelbach avatar brycelelbach commented on June 17, 2024

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.

brycelelbach avatar brycelelbach commented on June 17, 2024

@griwes suggests "sender consumer" instead of "sender sink". That seems fine to me.

from stdexec.

brycelelbach avatar brycelelbach commented on June 17, 2024

"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.

brycelelbach avatar brycelelbach commented on June 17, 2024

See #85

from stdexec.

brycelelbach avatar brycelelbach commented on June 17, 2024

@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.

brycelelbach avatar brycelelbach commented on June 17, 2024

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.

brycelelbach avatar brycelelbach commented on June 17, 2024

Long term, I wonder if we can rename "operation state" to something else.

from stdexec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.