Coder Social home page Coder Social logo

Comments (4)

sasa1977 avatar sasa1977 commented on September 27, 2024 1

Yes, the valid macros from which stop_server/1 can be used are documented here.

I guess for the sake of completion we could add macros for :ignore and {:stop, reason :: any}. The problem is that stop for defstart (which is init/1) would have to be differently named, so I wonder if it's worth it, because you can just return {:stop, reason}. The main motivation behind the existing responder macros was to have pipe friendly interface, so you can just pipe the state into the callback return value. IMO, that advantage is less relevant with the {:stop, reason} and :ignore tuples, so I currently have some reservations about adding the support for them.

from exactor.

sasa1977 avatar sasa1977 commented on September 27, 2024 1

Yes, good idea. I’ll think a bit about this, and then either document the intent better, or add the macros you requested. Thanks for pointing this out!

On 31 Mar 2016, at 01:11, OvermindDL1 [email protected] wrote:

True, I just like consistency in how functions visually flow, and some control functions ending in tuples and some ending in functions is just a touch jarring, but I am currently using {:stop, reason} right now. The piping is good reasoning for them, perhaps document that that is their purpose to help dissuade this?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub #17 (comment)

from exactor.

OvermindDL1 avatar OvermindDL1 commented on September 27, 2024

For note, the tuple in init for :stop is: {:stop, reason}
Thus no state is needed.

from exactor.

OvermindDL1 avatar OvermindDL1 commented on September 27, 2024

True, I just like consistency in how functions visually flow, and some control functions ending in tuples and some ending in functions is just a touch jarring, but I am currently using {:stop, reason} right now. The piping is good reasoning for them, perhaps document that that is their purpose to help dissuade this?

from exactor.

Related Issues (19)

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.