eclipse-thingweb / node-wot

A fast and extensible framework to connect any device with your browser and backend applications
https://thingweb.io
Other
162 stars 79 forks source link

[question] Why is longpoll default in HTTP Consumer? #863

Open egekorkan opened 1 year ago

egekorkan commented 1 year ago

Currently, the HTTP client implementation uses longpoll when it is not indicated in the subprotocol field: https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-http/src/http-client-impl.ts#L159

It sort of makes sense but the reason for it is not super clear to me.

danielpeintner commented 1 year ago

@egekorkan Mhh, I think this was the default assumption. I wonder what we can/should do if the subprotocol is not given?

egekorkan commented 1 year ago

I think that this generally an interesting point for HTTP Bindings everywhere. There is no built-in mechanism for eventing in HTTP or to be specific, no mechanism can be assumed without a subprotocol field. I will open an issue in binding templates about it to discuss what should be standardized and whether longpoll should be the default mechanism.