- Asynchronous code is how you write low-resource, high-concurrency servers. See http://www.kegel.com/c10k.html.
- Node embracing async from the get-go means that servers are low-resource, high-concurrency by default.
- Async + JavaScript = Perfect fit for an event loop.
- When it comes to threads vs event-loop, there are times when either are advantageous.
- But there are things very hard or impossible to do with threads.
- WebSockets are difficult to do properly with threads. That's one example where non-blocking IO (async) has a major advantage.
- RAM usage is another factor, especially when we're talking about the physical hardware required to run your application, which translates to real dollars.
- It depends on your application in the end:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Option defaults | |
| OPT="value" | |
| # getopts string | |
| # This string needs to be updated with the single character options (e.g. -f) | |
| opts="fvo:" | |
| # Gets the command name without path | |
| cmd(){ echo `basename $0`; } |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Find wp-config.php | |
| for ( $i = 0; $i < $depth = 10; $i++ ) { | |
| $path = str_repeat( '../', $i ); | |
| if ( file_exists( $path . 'wp-config.php' ) ) { | |
| require_once( $path . 'wp-config.php' ); | |
| break; | |
| } | |
| } |
NewerOlder