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
The HTTP extensions are fetched from the origin HTTP request and passed in the rpc middleware layers and rpc handler which is cloned for every rpc call.
Ideally we would wrap the extensions in an Arc/Mutex so the extensions could be shared without cloning but
because middleware layer can modify the extensions and such side-effects shouldn't impact future calls.
For instance if the state is shared then future rpc calls will inherit the state from past rpc calls which we don't want.
Cloning the http extensions comes with an overhead roughly 16 bytes by default but if users
put lots of data in the http extensions it could impact performance and memory usage significantly
The text was updated successfully, but these errors were encountered:
The HTTP extensions are fetched from the origin HTTP request and passed in the rpc middleware layers and rpc handler which is cloned for every rpc call.
HTTP request -> connect -> extensions.clone() -> rpc middleware -> rpc service -> response
Ideally we would wrap the extensions in an Arc/Mutex so the extensions could be shared without cloning but
because middleware layer can modify the extensions and such side-effects shouldn't impact future calls.
For instance if the state is shared then future rpc calls will inherit the state from past rpc calls which we don't want.
Cloning the http extensions comes with an overhead roughly 16 bytes by default but if users
put lots of data in the http extensions it could impact performance and memory usage significantly
The text was updated successfully, but these errors were encountered: