-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14ce91c
commit 215765d
Showing
269 changed files
with
267 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
assets/js/runtime~main.40ea822a.js → assets/js/runtime~main.4c947df4.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
@@ -63,6 +63,7 @@ <h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="preparedmessage-type">P | |
<p>Then there is a method <a href="https://pkg.go.dev/github.com/gorilla/websocket#Conn.WritePreparedMessage" target="_blank" rel="noopener noreferrer">func (*Conn) WritePreparedMessage</a>, which should be used to write data to all connections interested in a message — the proper WebSocket frame will be created once and then automatically re-used. By the way, this is an example of the <a href="https://github.com/gorilla/websocket/blob/ce903f6d1d961af3a8602f2842c8b1c3fca58c4d/prepared.go#L72" target="_blank" rel="noopener noreferrer">elegant use</a> of <code>sync.Once</code>.</p> | ||
<div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockTitle_Ktv7">Using PreparedMessage</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">preparedMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">_</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> websocket</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">NewPreparedMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">websocket</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">TextMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token boolean" style="color:rgb(255, 88, 116)">_</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">:=</span><span class="token plain"> conn</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">WritePreparedMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">preparedMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> | ||
<p>This means that if we broadcast the same prepared message to many connections, we remove the excessive load on <code>sync.Pool</code>, just taking a one <code>flate.Writer</code> from the pool instead of many. This way, we avoid large memory spikes due to big size of <code>flate.Writer</code> objects and <code>sync.Pool</code> growth.</p> | ||
<p>For broadcasts, <code>PreparedMessage</code> approach significantly reduces CPU usage by minimizing the need to construct and compress WebSocket frames, especially as the number of concurrent subscribers increases. Additionally, it reduces the allocation of large <code>flate.Writer</code> objects, further optimizing CPU utilization.</p> | ||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="preparedmessage-cache">PreparedMessage cache<a href="#preparedmessage-cache" class="hash-link" aria-label="Direct link to PreparedMessage cache" title="Direct link to PreparedMessage cache"></a></h2> | ||
<p>For Centrifuge/Centrifugo though, we couldn't directly use <code>PreparedMessage</code> in the part of the code responsible for preparing messages for channel broadcasts. This is because doing so would introduce a dependency on a WebSocket-specific type in a layer of code that should remain agnostic to the underlying real-time transport.</p> | ||
<p>To avoid this, we chose not to rely on the <code>PreparedMessage</code> type in the broadcasting preparation layer. Instead, we implemented a cache of <code>PreparedMessage</code> types within the WebSocket transport implementation layer.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Centrifugo" href="/opensearch.xml"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"><link rel="stylesheet" href="/assets/css/styles.446fbcdd.css"> | ||
<script src="/assets/js/runtime~main.40ea822a.js" defer="defer"></script> | ||
<script src="/assets/js/runtime~main.4c947df4.js" defer="defer"></script> | ||
<script src="/assets/js/main.dd41ea7a.js" defer="defer"></script> | ||
</head> | ||
<body class="navigation-with-keyboard"> | ||
|
Oops, something went wrong.