{"id":5569,"date":"2018-08-09T00:41:21","date_gmt":"2018-08-09T04:41:21","guid":{"rendered":"https:\/\/www.dr-chuck.com\/csev-blog\/?p=5569"},"modified":"2018-08-09T13:53:20","modified_gmt":"2018-08-09T17:53:20","slug":"tsugi-support-for-websockets","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2018\/08\/tsugi-support-for-websockets\/","title":{"rendered":"Tsugi Support for WebSockets"},"content":{"rendered":"<p>I just finished adding support for a WebSocket based notification service to Tsugi. \u00a0 It is not a full-up WebSocket server or SocketIO server where you can put a bunch of business logic and data storage in the socket server &#8211; it is just a low-latency notification service that can be used to make applications quicker and more efficient compared to techniques like polling. \u00a0Here is some documentation on the approach:<\/p>\n<p><a href=\"http:\/\/do1.dr-chuck.com\/tsugi\/phpdoc\/Tsugi\/Core\/WebSocket.html\">http:\/\/do1.dr-chuck.com\/tsugi\/phpdoc\/Tsugi\/Core\/WebSocket.html<\/a><\/p>\n<p>Here is a simple test harness that exercises Web Sockets that you can run in your Tsugi:<\/p>\n<p><a href=\"https:\/\/github.com\/tsugiproject\/socket-test\">https:\/\/github.com\/tsugiproject\/socket-test<\/a><\/p>\n<p>Here is a more complete chat application with messages, presence, and history and uses notification to work better. \u00a0It functions whether or not WebSocket notification is available &#8211; it is just more sluggish and has a performance impact when WebSockets are not available:<\/p>\n<p><a href=\"https:\/\/github.com\/tsugitools\/michat\">https:\/\/github.com\/tsugitools\/michat<\/a><\/p>\n<p>You can play with the Chat tool at:<\/p>\n<p><a href=\"https:\/\/www.tsugicloud.org\/tsugi\/store\/details\/michat\">https:\/\/www.tsugicloud.org\/tsugi\/store\/details\/michat<\/a><\/p>\n<p>I am going to record a walkthrough video of socket-test and michat sometime soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just finished adding support for a WebSocket based notification service to Tsugi. \u00a0 It is not a full-up WebSocket server or SocketIO server where you can put a bunch of business logic and data storage in the socket server &#8211; it is just a low-latency notification service that can be used to make applications [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-5569","post","type-post","status-publish","format-standard","hentry","category-tsugi"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=5569"}],"version-history":[{"count":7,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5569\/revisions"}],"predecessor-version":[{"id":5576,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5569\/revisions\/5576"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=5569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=5569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=5569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}