Re: MetaData for websocket connections
On Thu, Mar 26, 2020 at 10:59 AM Thomas Heigl wrote: > Hi Martin, > > It is not really necessary as you pointed out, but an external registry > forces me to override the default IWebSocketConnectionRegistry so I can > update the external registry when connections are > added and removed. > I guess you don't want to use WebSocketBehavior's onConnect() and onClose/onError() callbacks due to the "avoid loading the page if not necessary" problem. > > If connections themselves would support metadata, there would be no need > for an external registry plus the required glue code for keeping the > registry up to date. > > But if you prefer not to add functionality I can go ahead and implement an > external solution and see how it goes. > Anyone else having an opinion on this? > > Best regards, > > Thomas > > On Wed, Mar 25, 2020 at 7:19 PM Martin Grigorov > wrote: > > > Hi Thomas, > > > > Is this really necessary? > > You can achieve the same today by using an external registry. > > E.g. List channels = channelRegistry.get(webSocketConnection); > > internally the registry can use WebSocketConnection's > > getApplication().getName(), getSessionId() and getKey() to construct the > > key. > > > > MetaData would do the job as well, but I'd prefer to not add more > > functionality unless really needed. > > > > Regards, > > Martin > > > > On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl > wrote: > > > > > Hi all, > > > > > > I'd like to add metadata to websocket connections. For instance, which > > > events or channels a connection is subscribed to. > > > > > > What do you think about adding MetaDataEntry[] metaData to > connections > > > and setMetaData/getMetaData to IWebSocketConnection? > > > > > > Best regards, > > > > > > Thomas > > > > > >
Re: MetaData for websocket connections
Hi Martin, It is not really necessary as you pointed out, but an external registry forces me to override the default IWebSocketConnectionRegistry so I can update the external registry when connections are added and removed. If connections themselves would support metadata, there would be no need for an external registry plus the required glue code for keeping the registry up to date. But if you prefer not to add functionality I can go ahead and implement an external solution and see how it goes. Best regards, Thomas On Wed, Mar 25, 2020 at 7:19 PM Martin Grigorov wrote: > Hi Thomas, > > Is this really necessary? > You can achieve the same today by using an external registry. > E.g. List channels = channelRegistry.get(webSocketConnection); > internally the registry can use WebSocketConnection's > getApplication().getName(), getSessionId() and getKey() to construct the > key. > > MetaData would do the job as well, but I'd prefer to not add more > functionality unless really needed. > > Regards, > Martin > > On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl wrote: > > > Hi all, > > > > I'd like to add metadata to websocket connections. For instance, which > > events or channels a connection is subscribed to. > > > > What do you think about adding MetaDataEntry[] metaData to connections > > and setMetaData/getMetaData to IWebSocketConnection? > > > > Best regards, > > > > Thomas > > >
Re: MetaData for websocket connections
Hi Thomas, Is this really necessary? You can achieve the same today by using an external registry. E.g. List channels = channelRegistry.get(webSocketConnection); internally the registry can use WebSocketConnection's getApplication().getName(), getSessionId() and getKey() to construct the key. MetaData would do the job as well, but I'd prefer to not add more functionality unless really needed. Regards, Martin On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl wrote: > Hi all, > > I'd like to add metadata to websocket connections. For instance, which > events or channels a connection is subscribed to. > > What do you think about adding MetaDataEntry[] metaData to connections > and setMetaData/getMetaData to IWebSocketConnection? > > Best regards, > > Thomas >
MetaData for websocket connections
Hi all, I'd like to add metadata to websocket connections. For instance, which events or channels a connection is subscribed to. What do you think about adding MetaDataEntry[] metaData to connections and setMetaData/getMetaData to IWebSocketConnection? Best regards, Thomas