The driver uses a connection pool at all times, by default it creates and frees connections automatically. It's safe for concurrent use by multiple goroutines.
session, err = r.Connect(r.ConnectOpts{ Address: url, InitialCap: 10, MaxOpen: 10, })
My approach right now would be a global firestore.Client handling all querys, inserts,...
Like so:
var (
Firestore *firestore.Client
)
func init() {
ctx := context.TODO()
var err error
Firestore, err = firestore.NewClient(ctx, "project-id")
if err != nil {
fmt.Printf("Error %v", err)
}
}
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/6729df0c-689a-484f-a688-ce2051a5bef5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Perfect, thank you, so using the same client over multiple for example http.HandleFuncs should not be running into connectivity issues ?
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/0e7d8055-0a55-42f3-95ae-d052dfb317fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.