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
logging middleware could hook into certain events through the WebSocket upgrade and connection
metrics middleware could housekeep times and durations of WebSocket upgrade states
Some of this is possible now, but it requires to wrap ResponseWriters and it is not granular enough.
Implementation
It could be something like:
typeEventintconst (
InternalErrorEvent=iotaBackendDialFailedBackendDialSucceededUpgradeFailedUpgradeSucceededClosedClosedAbnormalClosure
)
typeWebsocketProxystruct {
...// Observer, if non-nil is called at certain actions and states through the// WebSocket upgrade process carried out in ServeHTTP. It provides a way for// clients/middleware to hook in actions in these notifications.// The Event parameter carries the event and the string parameter carries// an informational string suitable for logging.Observerfunc(Event, string)
...
}
The provided event and the Observer signature are just a suggestion.
Also, events could be notified using a channel. However, actions on the receiver side should
be short, and channel messaging could be implemented in the observer, if needed.
The text was updated successfully, but these errors were encountered:
Motivation
Some of this is possible now, but it requires to wrap ResponseWriters and it is not granular enough.
Implementation
It could be something like:
The provided event and the
Observer
signature are just a suggestion.Also, events could be notified using a channel. However, actions on the receiver side should
be short, and channel messaging could be implemented in the observer, if needed.
The text was updated successfully, but these errors were encountered: