You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can use ListenAndServe, and get rid of the listener on the Server structs in gateway+rpc by creating a new constructor that overrides the http server. Using ListenAndServe alone does not allow us to use port 0 in tests without losing the port that gets assigned. @walldiss pointed out we can create a new constructor and pass in a server from the httptest package.
Update the server to not use Listener and make lifecycling over HTTP Server directly
distractedm1nd
changed the title
feat(rpc/gateway): add WithServer to servers + move to ListenAndServe
feat(rpc/gateway): move to ListenAndServe
Nov 2, 2022
We can use
ListenAndServe
, and get rid of thelistener
on theServer
structs in gateway+rpcby creating a new constructor that overrides the http server. Using ListenAndServe alone does not allow us to use port 0 in tests without losing the port that gets assigned. @walldiss pointed out we can create a new constructor and pass in a server from thehttptest
package.Originally posted by @Wondertan in #1199 (comment)
The text was updated successfully, but these errors were encountered: