Skip to content

Commit

Permalink
Mark MESOP_CONCURRENT_UPDATES_ENABLED as deprecated and update WebSoc…
Browse files Browse the repository at this point in the history
…kets docs (#1223)
  • Loading branch information
wwwillchen authored Mar 5, 2025
1 parent 669f625 commit 1808acb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ If you want to show unredacted errors, including in prod mode, set this to `true

These configuration values are experimental and are subject to breaking change, including removal in future releases.

### MESOP_CONCURRENT_UPDATES_ENABLED
### MESOP_CONCURRENT_UPDATES_ENABLED (DEPRECATED)

!!! warning "Experimental feature"
!!! danger "Deprecated experimental feature"

This is an experimental feature and is subject to breaking change. There are many bugs and edge cases to this feature.
This experimental feature is deprecated and will be removed in an upcoming release. Use `MESOP_WEBSOCKETS_ENABLED` instead.

Allows concurrent updates to state in the same session. If this is not updated, then updates are queued and processed sequentially.

Expand All @@ -257,7 +257,14 @@ By default, this is not enabled. You can enable this by setting it to `true`.

This is an experimental feature and is subject to breaking change. Please follow [https://github.com/google/mesop/issues/1028](https://github.com/google/mesop/issues/1028) for updates.

This uses WebSockets instead of HTTP Server-Sent Events (SSE) as the transport protocol for UI updates. If you set this environment variable to `true`, then [`MESOP_CONCURRENT_UPDATES_ENABLED`](#MESOP_CONCURRENT_UPDATES_ENABLED) will automatically be enabled as well.
This uses WebSockets instead of HTTP Server-Sent Events (SSE) as the transport protocol for UI updates. Using WebSockets also changes the Mesop server architecture to be stateful (e.g. meaning a server restart or routing to a different server instance means the user will lose state). If you enable this feature, then you should ensure the following:

- Either a single server instance is used *or* you route a particular user to the same server for a given session (i.e. [session affinity](https://cloud.google.com/run/docs/configuring/session-affinity)).
- Either ensure user state is *not* critical (e.g. it's OK if it's cleared out due to server restart, which could happen at any time on typical cloud infrastructure) or is persisted somewhere (e.g. written to a database).

Enabling this also allows user events to be handled concurrently, which is particularly useful supporting interactivity for long-running event handlers.

By default, this is not enabled. You can enable this by setting it to `true`.

### MESOP_APP_BASE_PATH

Expand Down

0 comments on commit 1808acb

Please sign in to comment.