Documentation ¶
Overview ¶
context implements a request/reply server that utilizes a pool of worker goroutines to service multiple requests simultaneously. Each goroutine has it's own context which keeps track of which client the request came from so that it can reply to the correct client.
The server is a listening rep socket, and client is a dialing req socket.
To use:
$ go build . $ url=tcp://127.0.0.1:40899 $ $ ./context server $url & server=$! && sleep 1 $ ./context client $url "John" $ ./context client $url "Bill" $ ./context client $url "Mary" $ ./context client $url "Susan" $ ./context client $url "Mark" $ kill $server
Click to show internal directories.
Click to hide internal directories.