mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-17 02:21:04 +00:00
add the usage of integrating with http server
This commit is contained in:
parent
22c71e561b
commit
697a030105
@ -121,7 +121,7 @@ func main() {
|
|||||||
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
||||||
request, ok := payload.(Request)
|
request, ok := payload.(Request)
|
||||||
if !ok {
|
if !ok {
|
||||||
request = Request{Result: make(chan []byte)}
|
request = Request{Param:[]byte(""), Result: make(chan []byte)}
|
||||||
}
|
}
|
||||||
reverseParam := func(s []byte) []byte {
|
reverseParam := func(s []byte) []byte {
|
||||||
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
||||||
|
|||||||
@ -120,7 +120,7 @@ func main() {
|
|||||||
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
||||||
request, ok := payload.(Request)
|
request, ok := payload.(Request)
|
||||||
if !ok {
|
if !ok {
|
||||||
request = Request{Result: make(chan []byte)}
|
request = Request{Param:[]byte(""), Result: make(chan []byte)}
|
||||||
}
|
}
|
||||||
reverseParam := func(s []byte) []byte {
|
reverseParam := func(s []byte) []byte {
|
||||||
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
||||||
|
|||||||
@ -16,7 +16,7 @@ func main() {
|
|||||||
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) {
|
||||||
request, ok := payload.(Request)
|
request, ok := payload.(Request)
|
||||||
if !ok {
|
if !ok {
|
||||||
request = Request{Result: make(chan []byte)}
|
request = Request{Param:[]byte(""), Result: make(chan []byte)}
|
||||||
}
|
}
|
||||||
reverseParam := func(s []byte) []byte {
|
reverseParam := func(s []byte) []byte {
|
||||||
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user