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
NginX/NginX OpenResty的内建及扩展模块的phase先后执行次序: | |
参考: http://wiki.nginx.org/Phases | |
http://blog.sina.com.cn/openresty | |
需要关注的phase有: | |
-1:http config: | |
在/usr/local/openresty/nginx/conf/nginx.conf的http段落有可以载入lua的共用函数, 比如: | |
init_by_lua_file /var/workspace/www/violation_nginx/lf; | |
0.server selection: server(listen, server_name) |
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
(define chan-1 (make-chan)) | |
(define chan-2 (make-chan)) | |
(go (chan<- chan-1 'hello-chan-1)) | |
(go (chan<- chan-2 'hello-chan-2)) | |
; sleep for 20 millisecond | |
(sleep 20) | |
(select |
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
; define channels | |
(define ping-chan (make-chan)) | |
(define pong-chan (make-chan)) | |
; define a buffered channel | |
(define sem (make-chan 2)) | |
(define (ping n) | |
(if (> n 0) | |
(begin | |
(display (<-chan ping-chan)) |
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
$(document).ready(function(){ | |
var s1 = [3843, 34455, 299985, 456175]; | |
var s2 = [3206, 32891, 317676, 496311]; | |
// Can specify a custom tick Array. | |
// Ticks should match up one for each y value (category) in the series. | |
var ticks = ['1000', '10000', '100000', '150000']; | |
var plot1 = $.jqplot('chart1', [s1, s2], { | |
title: 'Time spent in event processing <br/>\ | |
100 active clients', |