Go,PHP,Swoole 並行測試詳解

2020-07-16 10:06:01

Go

package mainimport (
    "fmt"
    _ "fmt"
    "net/http"
    _ "os")func main() {
    http.HandleFunc("/", handle)
    http.ListenAndServe("0.0.0.0:8082",nil)}func handle(w http.ResponseWriter,r *http.Request) {
    fmt.Fprint(w,"URL=",r.URL.Path)
    fmt.Println(r.RequestURI)}

PHP內建服務

echo 1;

Swoole

$http = new SwooleHttpServer("0.0.0.0", 9501);$http->on('request', function ($request, $response) {
    echo 1;});$http->start();

以上就是Go,PHP,Swoole 並行測試詳解的詳細內容,更多請關注TW511.COM其它相關文章!