This file contains 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
var HTTPParser = process.binding('http_parser').HTTPParser | |
var parser = new HTTPParser(HTTPParser.RESPONSE); | |
parser[HTTPParser.kOnHeaders] = function(headers, url) { | |
console.log('onHeaders'); | |
} | |
parser[HTTPParser.kOnHeadersComplete] = function(info) { | |
console.log('-------- onHeadersComplete --------'); | |
console.log(info); |
This file contains 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
var eventes = require('eventemitter2').EventEmitter2 | |
, fastcgi = require('fastcgi-parser') | |
, net = require('net') | |
, util = require('util'); | |
/** | |
* Fastcgi Stream | |
* | |
* @package library | |
* @author Yujiro Takahashi <yujiro3@gmail.com> |
This file contains 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
var net = require("net"); | |
var fastcgi = require("fastcgi-parser"); | |
/** | |
* 接続とヘッダー送信 | |
* | |
*/ | |
var client = net.connect({path: '/var/run/php5-fpm.sock'}, function() { | |
console.log('client connected'); |
This file contains 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
<?php | |
/** | |
* GroongaHTTPフォーマット出力 | |
* | |
* PHP versions 5.4.x | |
* | |
* index.php : https://gist.github.com/Yujiro3/ | |
* Copyright (c) 2011-2014 sheeps.me All Rights Reserved. | |
* | |
* @package exchanger |
This file contains 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
<?php | |
exec('rm -rf ./db; mkdir ./db'); | |
/* DB接続 */ | |
$gdb = new Groonga('./db/test.db'); | |
/* table_create --name Users --flags TABLE_HASH_KEY --key_type ShortText */ | |
$gdb->table('Users') | |
->flags('TABLE_HASH_KEY') | |
->keyType('ShortText') |
This file contains 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
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <groonga/groonga.h> | |
int main (int argc, char **argv) { | |
grn_ctx ctx; | |
grn_obj *db; | |
grn_ctx_info info; | |
const char *path = "db/test.db"; |