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
I am creating a reader to stream the last of function output messages to a browser connection:
eader, err:=s.pclient.CreateReader(
pulsar.ReaderOptions{
Topic: common.TopicName(common.Tenant, common.NamespaceAgent, uuid),
StartMessageID: pulsar.EarliestMessageID(),
Name: fmt.Sprintf("results_%s_%d", uuid, time.Now().UnixNano()),
},
)
iferr!=nil {
respond(w, errorResponse("failed to create reader: "+err.Error()), http.StatusInternalServerError)
return
}
iferr:=reader.SeekByTime(time.Now().Add(-1*time.Hour)); err!=nil {
respond(w, errorResponse("failed to seek reader: "+err.Error()), http.StatusInternalServerError)
return
}
deferreader.Close()
w.Write([]byte(resultsStart))
forreader.HasNext() {
msg, err:=reader.Next(rctx)
iferr!=nil {
// if we encounter an error, add a dummy dict in case there's a comma, then close the list and add the error to the responsefmt.Fprintf(w, `{}],"error":"error during results iteration: %s"}`, err)
f.Flush()
return
}
Expected behavior
If there are no results, HasNext() should return false and the handler should proceed.
Actual behavior
Hangs forever.
The text was updated successfully, but these errors were encountered:
I am creating a reader to stream the last of function output messages to a browser connection:
Expected behavior
If there are no results,
HasNext()
should returnfalse
and the handler should proceed.Actual behavior
Hangs forever.
The text was updated successfully, but these errors were encountered: