Home >Backend Development >PHP Tutorial >Detailed explanation of concurrent testing in Go, PHP and Swoole

Detailed explanation of concurrent testing in Go, PHP and Swoole

coldplay.xixi
coldplay.xixiforward
2020-07-02 17:55:332521browse

Detailed explanation of concurrent testing in Go, PHP and Swoole

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)}

Related learning recommendations: PHP programming from entry to proficiency

##PHP built-in service
echo 1;

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

The above is the detailed content of Detailed explanation of concurrent testing in Go, PHP and Swoole. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:webhek.com. If there is any infringement, please contact admin@php.cn delete