Why I cannot get messages in real-time but only when the browser closes the pending call?
See original GitHub issueI’m trying to use protobuf-ts with server streaming (https://github.com/improbable-eng/grpc-web/tree/master/go/grpcweb in Golang) but I don’t get messages from server until connection is closed.
I’m using Svelte 3 like this:
<script lang="ts">
import { onDestroy, onMount } from 'svelte';
const transport = new GrpcWebFetchTransport({ baseUrl: '/', format: 'binary' });
const service = new EventServiceClient(transport)
const abortController = new AbortController();
onMount(async () => {
const call = service.flow({}, { abort: abortController.signal });
for await (const response of call.responses) {
console.log('got another response!', response);
}
});
onDestroy(() => abortController.abort());
</script>
The call in in pending state for about 2.2 min. After that I get all messages logged in console.
I need them in real-time!
Where am I doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Fix problems sending, receiving or connecting to Messages
Make sure your phone has background data turned on for the Messages app. Open your device's settings. Tap Network & internet and then...
Read more >[Question] what is the reason when the "Browser.close ...
When I run using playwright-java to call browser.close(), ... The pending messages (5 pending messages) get pull off the queue and process ...
Read more >Life of a message from FCM to the device - The Firebase Blog
1. The device is offline: ... FCM cannot deliver the message if the device is not online. There are many devices that go...
Read more >Get realtime updates with Cloud Firestore - Firebase
An initial call using the callback you provide creates a document snapshot immediately with the current contents of the single document. Then, each...
Read more >Pull subscriptions | Cloud Pub/Sub Documentation
In synchronous pull mode, the receiving and processing of messages occur in sequence and are not decoupled from each other. Hence, similar to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am sorry you got stuck with this, but I’m afraid there is nothing we can do from the protobuf-ts side. This needs some debugging of the go code to pinpoint the cause.
If I remove that library from my backend server
protobuf-ts
streaming works withbinary
format too, not onlytext
.Here is the code for that middleware: https://github.com/volatiletech/authboss/blob/master/client_state.go#L123.