Comments (7)
What's the use case for having start not link? Do you have a proposal to do this in a backwards compatible way?
from mochiweb.
My use case was when I need to try starting mochiweb, but if its returning {error, eaddrinuse}, do something else. start/1
tricked me into believing that it does not link to the current process. Since it did, it actually crashed my gen_server, so I had to resort to gen_tcp:listen to try port's availability first.
Besides, it's just breaking the convention that start
doesn't link but start_link
does. I don't think this adjustment can be done in a backwards compatible way.
One option that I see is to add {link, boolean()} option to disable linking when necessary. It will not solve the problem of figuring out that start
does something it is not supposed to do, but at least it will provide a way to get around of that behaviour.
from mochiweb.
I agree that it would be ideal that start did not link, but backwards compatibility is a more important goal for us right now. The mistake was made several years ago, LOTS of code uses mochiweb (most of which we don't have any control over), and this is the first request to change that behavior to my knowledge.
Perhaps we could add a start_link, start/2, and add a deprecation message to start/1 or something like that. Definitely not something we could just fix very quickly.
from mochiweb.
start_link plus an option for using start in a way that it won't link ({link, false} option) will be great. Plus a documentation saying that until this is deprecated, start actually does link so people can have easier time figuring this out.
from mochiweb.
So I think I'm going to add a start_link/1 where appropriate and add a {link, false} option to start/1 with no deprecation warnings yet. I'll leave some comments in the code so that we know how to phase out the linked start/1 behavior carefully (will take a while to do it smoothly: add {link, false} and start_link/1, deprecation of start/1 without {link, false}, change default behavior, add deprecation warning for {link, false}, removal of {link, false}).
from mochiweb.
I think this should solve your request for now, with the expectation that we'll eventually phase out the current (stupid) default. Please re-open if you think something else needs to change.
from mochiweb.
thanks a lot! that was really quick :)
from mochiweb.
Related Issues (20)
- build failing on OTP 21 HOT 3
- automate the distribution release HOT 12
- badarg error when I visit my server HOT 6
- Strict-SSL HOT 5
- Warning On OTP 21.2 HOT 5
- Duplicated modules HOT 1
- Example https_store with erlang 21.2.4 failed cause tuple_call HOT 1
- ssl issue, how to fix? HOT 1
- Documentation for setting up the project HOT 1
- To get started HOT 1
- Contributing Doc and Issue flags
- about https HOT 1
- Latest release (v2.21.0, OTP 23/24 compat) not available on hex.pm? HOT 26
- why mochiweb_util:quote_plus/1 function encode \s to + while other encode %20
- error crypto:crypto_one_time cypher not supported HOT 2
- Remove Whitspaces in header values HOT 2
- mochiweb seems to be incompatible with otp 25 HOT 2
- Message Queue will grow when KeepAlive HOT 1
- Optionally remove trailing slashes for some tags? HOT 2
- edoc: error in doclet 'edoc_doclet': {'EXIT',error}.
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 mochiweb.