1"use strict";(self.webpackChunksample_website=self.webpackChunksample_website||[]).push([[1164],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(n),m=a,h=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return n?r.createElement(h,i(i({ref:t},u),{},{components:n})):r.createElement(h,i({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,i[1]=l;for(var p=2;p<o;p++)i[p]=n[p];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},2988:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=n(3117),a=(n(7294),n(3905));const o={title:"Monthly update #5",slug:"/monthly-update-5/",authors:"darrachequesne"},i=void 0,l={permalink:"/blog/monthly-update-5/",editUrl:"https://github.com/socketio/socket.io-website/edit/main/blog/2021-07-08-monthly-update-5.md",source:"@site/blog/2021-07-08-monthly-update-5.md",title:"Monthly update #5",description:"Hi everyone!",date:"2021-07-08T00:00:00.000Z",formattedDate:"July 8, 2021",tags:[],readingTime:1.32,hasTruncateMarker:!0,authors:[{name:"Damien Arrachequesne",title:"Maintainer of Socket.IO",url:"https://github.com/darrachequesne",imageURL:"https://github.com/darrachequesne.png",key:"darrachequesne"}],frontMatter:{title:"Monthly update #5",slug:"/monthly-update-5/",authors:"darrachequesne"},prevItem:{title:"Socket.IO 4.3.0",permalink:"/blog/socket-io-4-3-0/"},nextItem:{title:"Socket.IO 4.1.0",permalink:"/blog/socket-io-4-1-0/"}},s={authorsImageUrls:[void 0]},p=[{value:"A new API for inter-server communication",id:"a-new-api-for-inter-server-communication",level:2},{value:"New official adapters",id:"new-official-adapters",level:2},{value:"Additional documentation",id:"additional-documentation",level:2},{value:"Version updates",id:"version-updates",level:2},{value:"What's next",id:"whats-next",level:2}],u={toc:p},c="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Hi everyone!"),(0,a.kt)("p",null,"Here's the #5 edition of our Monthly update."),(0,a.kt)("p",null,"So, what's new in the Socket.IO ecosystem?"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#a-new-api-for-inter-server-communication"},"A new API for inter-server communication")),(0,a.kt)("li",{parentName:"ul"}
1,(0,a.kt)("a",{parentName:"li",href:"#new-official-adapters"},"New official adapters")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#additional-documentation"},"Additional documentation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#version-updates"},"Version updates")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#whats-next"},"What's next"))),(0,a.kt)("h2",{id:"a-new-api-for-inter-server-communication"},"A new API for inter-server communication"),(0,a.kt)("p",null,"This feature had been requested for quite some time, it is now implemented in release 4.1.0. It allows to broadcast events between your Socket.IO servers."),(0,a.kt)("p",null,"The syntax is very similar to the existing one, except it's for server-to-server communication:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},'io.serverSideEmit("hello", "world");\n')),(0,a.kt)("p",null,"And on the receiving side:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},'io.on("hello", (arg1) => {\n console.log(arg1); // prints "world"\n});\n')),(0,a.kt)("p",null,"Acknowledgements are supported too:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},'// server A\nio.serverSideEmit("ping", (err, responses) => {\n console.log(responses[0]); // prints "pong"\n});\n\n// server B\nio.on("ping", (cb) => {\n cb("pong");\n});\n')),(0,a.kt)("p",null,"You can find the complete release notes ",(0,a.kt)("a",{parentName:"p",href:"/blog/socket-io-4-1-0/"},"here"),"."),(0,a.kt)("h2",{id:"new-official-adapters"},"New official adapters"),(0,a.kt)("p",null,"Historically, the Redis adapter was the only official adapter when scaling to multiple nodes."),(0,a.kt)("p",null,"There are now three additional official adapters:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"the ",(0,a.kt)("a",{parentName:"li",href:"/docs/v4/mongo-adapter/"},"MongoDB adapter")),(0,a.kt)("li",{parentName:"ul"},"the ",(0,a.kt)("a",{parentName:"li",href:"/docs/v4/postgres-adapter/"},"Postgres adapter")),(0,a.kt)("li",{parentName:"ul"},"the ",(0,a.kt)("a",{parentName:"li",href:"/docs/v4/cluster-adapter/"},"cluster adapter"))),(0,a.kt)("p",null,"Note: the first two were inspired from existing adapters maintained by the community and were updated to support Socket.IO v3."),(0,a.kt)("p",null,"All of them supports the ",(0,a.kt)("a",{parentName:"p",href:"/docs/v4/server-instance/#utility-methods"},"utility methods")," that were added in v4, including the ",(0,a.kt)("inlineCode",{parentName:"p"},"serverSideEmit()")," method described above."),(0,a.kt)("h2",{id:"additional-documentation"},"Additional documentation"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"usage with bundlers like webpack for the ",(0,a.kt)("a",{parentName:"li",href:"/docs/v4/client-with-bundlers/"},"client")," and the ",(0,a.kt)("a",{parentName:"li",href:"/docs/v4/server-with-bundlers/"},"server")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/v4/pm2/"},"usage with PM2"))),(0,a.kt)("h2",{id:"version-updates"},"Version updates"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/socketio/socket.io/releases/tag/4.1.2"},"[email protected]")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/socketio/socket.io-client/releases/tag/4.1.2"},"[email protected]"))),(0,a.kt)("h2",{id:"whats-next"},"What's next"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a continuous focus on the documentation (additional code examples, extended guide, ...)"),(0,a.kt)("li",{parentName:"ul"},"additional tooling around Socket.IO")),(0,a.kt)("p",null,"Happy coding!"))}d.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.