On Tuesday, 30 March 2021 at 11:50:07 UTC+1 cpu...@gmail.com wrote:
> On Monday, March 29, 2021 at 9:05:50 PM UTC+2 rog wrote:
>
>> I often call net.Listen directly before calling Serve in a goroutine.
>> That way you can connect to the server's socket immediately even though the
>> server
On Monday, March 29, 2021 at 9:05:50 PM UTC+2 rog wrote:
> I often call net.Listen directly before calling Serve in a goroutine. That
> way you can connect to the server's socket immediately even though the
> server might take a while to get around to serving the request.
>
It seems this
I often call net.Listen directly before calling Serve in a goroutine. That
way you can connect to the server's socket immediately even though the
server might take a while to get around to serving the request.
Look at how net/http/httptest does it.
On Sat, 27 Mar 2021, 14:13 cpu...@gmail.com,
On Sat, Mar 27, 2021 at 3:19 PM 'Axel Wagner' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> The best way to do it is probably by making an HTTP request and see if it
> succeeds. In production, it's always a good idea to have a health check
> endpoint anyways. So some service manager
The best way to do it is probably by making an HTTP request and see if it
succeeds. In production, it's always a good idea to have a health check
endpoint anyways. So some service manager can check if it's alive and
restart it if necessary. Or so that a load balancer doesn't send traffic
until the
The typical Go tutorials pattern for starting a server is something like
log.Fatal(http.ListenAndServe(":8080"))
But what if the application needs to do other things after the server is
started? It seems there is virtually no method to wait for the server
actually start listening to