Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rdlowrey
rdlowrey / pthreads-shutdown-worker.php
Last active December 20, 2015 05:09
Handling fatal errors inside threads via register_shutdown_function
<?php
class Worker extends \Worker {
function run() {
// &$this ref required to avoid segfault
register_shutdown_function([&$this, 'onShutdown']);
}
private function onShutdown() {
@rdlowrey
rdlowrey / libevent.md
Last active March 28, 2016 06:24
libevent aerys benchmarks

100k Requests -- 100 concurrent clients

ab -n 100000 -c 100 -k http://127.0.0.1:1337/

Server Software:        
Server Hostname:        127.0.0.1
Server Port:            1337

Document Path:          /
@rdlowrey
rdlowrey / request-params.md
Created June 22, 2012 15:03
Name/Value Parameters in PHP's HTTP Request Modeling

Name/Value Parameters in PHP's HTTP Request Modeling

For many PHP devs, their first experience with HTTP request parameters comes in the form of the $_GET and $_POST superglobals. These globally accessible arrays are an easily digestable abstraction of the HTTP spec. Indeed, for basic applications operating only in the context of common browser user-agents, these eminently accessible parameter collections work well.

But there are some significant problems with $_GET and $_POST under the surface: