You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/28 20:19:06 UTC

[GitHub] [beam] lostluck commented on a diff in pull request #21979: Add Search transform to Go FhirIO

lostluck commented on code in PR #21979:
URL: https://github.com/apache/beam/pull/21979#discussion_r908907181


##########
sdks/go/pkg/beam/io/fhirio/common.go:
##########
@@ -23,31 +23,33 @@ import (
 	"context"
 	"io"
 	"net/http"
-	"regexp"
 	"time"
 
 	"github.com/apache/beam/sdks/v2/go/pkg/beam"
 	"github.com/apache/beam/sdks/v2/go/pkg/beam/core"
 	"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
+	"google.golang.org/api/googleapi"
 	"google.golang.org/api/healthcare/v1"
 	"google.golang.org/api/option"
 )
 
 const (
-	UserAgent        = "apache-beam-io-google-cloud-platform-healthcare/" + core.SdkVersion
-	baseMetricPrefix = "fhirio/"
+	UserAgent             = "apache-beam-io-google-cloud-platform-healthcare/" + core.SdkVersion
+	baseMetricPrefix      = "fhirio/"
+	pageTokenParameterKey = "_page_token"
 )
 
-func executeRequestAndRecordLatency(ctx context.Context, latencyMs *beam.Distribution, requestSupplier func() (*http.Response, error)) (*http.Response, error) {
+func executeAndRecordLatency[T any](ctx context.Context, latencyMs *beam.Distribution, executionSupplier func() (T, error)) (T, error) {

Review Comment:
   Yes! Especially for repetitive internal details. If the generics are accessible from the user side API, clear documentation needs to set expectations.
   
   If things aren't repetitive, the main question in that case is "why make it generic?". It's easy enough to add later, and difficult to remove if we decide against it later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org