[go-nuts] Re: [generics] Replace () with <> or other character

2020-06-18 Thread Nathanael Curin
An argument for this is also that (all ?) languages that use generics use <>. It might make learning just easier for new Go developers that have experience from generics-compatible languages. Dimas -> Resembling other languages in some ways is not necessarily a bad thing, if the idea behind it

Re: [go-nuts] Dependency injection in gorillamux handlers

2019-09-25 Thread Nathanael Curin
// or > myRouter.HandleFunc("/endpoint1/", h.Endpoint1).Methods("POST", "OPTIONS") > > > > On Mon, Sep 23, 2019 at 2:37 AM Nathanael Curin > wrote: > >> I'm avoiding context.WithValue since I feel the objects I'm dealing with >

Re: [go-nuts] Dependency injection in gorillamux handlers

2019-09-23 Thread Nathanael Curin
I'm avoiding context.WithValue since I feel the objects I'm dealing with are too "powerful" (i.e. not simple Values). For a read, a 2016 article on this : https://peter.bourgon.org/blog/2016/07/11/context.html I remember reading through another article saying the usage of WithValue is kind of ri

[go-nuts] Dependency injection in gorillamux handlers

2019-09-23 Thread Nathanael Curin
Hi everyone, I'm currently using the gorilla/mux package to make an API with a few handlers that depend on multiple external resources (a Redis DB for example). The fact is, HTTP Handlers only use http.ResponseWriter and *http.Request as parameter, so I used some random dependency injection pa

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
gt; > I think this is why you are hearing crickets. > > On May 10, 2019, at 7:05 AM, Nathanael Curin > wrote: > > Good point on the implementing side of things, it's cleaner. I'm still > really curious of the limits and implementation details - There has to be &g

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
t; the delay before it is cancelled ? Are the calls in the handler even > cancelable? What type of hardware (64+ cores?) > > I think this is why you are hearing crickets. > > On May 10, 2019, at 7:05 AM, Nathanael Curin > wrote: > > Good point on the implementing side of

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
ar a écrit : > > On Thu, May 9, 2019 at 9:03 AM Nathanael Curin > wrote: > > > > Hi everyone, > > > > Searching Go's documentation and this group didn't really help me find > what I'm looking for so, here goes. > > > > I'd like

[go-nuts] Timers and implementation of a timeout system on requests

2019-05-09 Thread Nathanael Curin
Hi everyone, Searching Go's documentation and this group didn't really help me find what I'm looking for so, here goes. I'd like to implement a timeout system on every request to my HTTP server that would work like this : - Receive an *http.Request*, perform initial checks on validity -