Coder Social home page Coder Social logo

Confusing use of `notify` about mini-redis HOT 4 OPEN

bbros-dev avatar bbros-dev commented on July 17, 2024
Confusing use of `notify`

from mini-redis.

Comments (4)

Darksonn avatar Darksonn commented on July 17, 2024 1

We had contemplated receiver but thought for new users, coming from other languages, it might be mistaken as an instance (or some such concept) of Receiver, while from (weak/flawed) memory it is a Future.

No, it isn't a Future. It is an instance of the type tokio::sync::broadcast::Receiver.


As for the word "monitor", I find that word very unnatural here. If we are to rephrase the sentence, I would prefer this:

/// Shutdown signals are received using a `broadcast::Receiver`.

from mini-redis.

Darksonn avatar Darksonn commented on July 17, 2024

Changing it to listen or receiver sounds reasonable to me. I do not think that collect and gather would be good names.

from mini-redis.

bbros-dev avatar bbros-dev commented on July 17, 2024

Thanks for the feedback. We had contemplated receiver but thought for new users, coming from other languages, it might be mistaken as an instance (or some such concept) of Receiver, while from (weak/flawed) memory it is a Future.

We're still working through this example so will likely wait a while before making an PR - to ensure we haven't misunderstood.

For future reference, we also thought this line (signalling is a synonym for sending):

/// Shutdown is signalled using a `broadcast::Receiver`.

might be better phrased:

/// Shutdown signals are monitored via a `broadcast::Receiver`.

Which of course suggests that monitor is a better replacement term for notify?

from mini-redis.

bbros-dev avatar bbros-dev commented on July 17, 2024

receiver it is then.

from mini-redis.

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.