---
schema_version: "1"
id: 44fe877aa81cef8b58bc741f6d47ae8e72ebd51de3b9b2ff60d1b777dfe8c827
title: Bidirectional Streaming
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/event-bus/pub-sub-api/guides/bidi-streaming.md
canonical_url: https://developer.salesforce.com/docs/platform/pub-sub-api/guide/bidi-streaming.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 491b5b6ca5e9d4cdeaf2a1a37b7272279b7c85320b25d1a53e66ee6de59e247e
products:
  - Pub/Sub API
  - Event Bus Docs
---
# Bidirectional Streaming

Bidirectional streaming is one of the four types of RPC methods that can be defined in a gRPC API. With bidirectional streaming, both the client and the server can send a sequence of messages to each other by using two independent streams. It’s not necessary for the client to wait until the server finishes sending all the messages to send new requests. Similarly, the server doesn’t wait until the client has sent all the messages before responding.

![Flow of bidirectional streaming between the client and the Pub/Sub API service](https://developer.salesforce.com/docs/media/pubsub-bidirectional-streaming.png '{"class": "image-lg", "title": "Flow of bidirectional streams between the client and the Pub/Sub API service"}')

The Subscribe and ManagedSubscribe (beta) methods use bidirectional streaming to subscribe to an Event Bus topic. The PublishStream method also uses bidirectional streaming. For more information, see [Core concepts, architecture and lifecycle](https://grpc.io/docs/what-is-grpc/core-concepts/) in the gRPC documentation.

**See Also**

- [Subscribe RPC Method](/docs/platform/pub-sub-api/references/methods/subscribe-rpc.html)
- [ManagedSubscribe RPC Method (Beta)](/docs/platform/pub-sub-api/references/methods/managedsubscribe-rpc.html)
- [PublishStream RPC Method](/docs/platform/pub-sub-api/references/methods/publishstream-rpc.html)
- [Pull Subscription and Flow Control](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/flow-control.md)
