Skip to content

Commit 2be2b20

Browse files
committed
Add optional compression feature
1 parent c9005f9 commit 2be2b20

File tree

12 files changed

+115
-90
lines changed

12 files changed

+115
-90
lines changed

docs-src/queuing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ What about 3, 4, or 900 queues? Numerous queues gets to be a pain to manage and,
9393
If it is desirable, different [configuration files](configuration) can be used to run multiple instances of InEngine.NET.
9494
Simply create a new config file with a new QueueName setting and point inengine.exe at it.
9595

96+
## Message Compression
97+
98+
Messages can be compressed when saved in the queue.
99+
It is important to understand the trade-offs of this feature before enabling it.
100+
Compressing messages takes more CPU resources and might negatively impact queueing throughput if the queued commands do not have a lot of internal state.
101+
Put simply, if the commands are too small to benefit from being compressed, then compressing them wastes resources.
102+
103+
If the commands have a lot of internal state, then this feature will reduce the queue's memory consumption.
104+
Also, in a high-throughput scenario, where network bandwidth is limited, this feature can greatly reduce the amount of bandwidth used.
105+

docs/commands/index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ <h2 id="create-a-command">Create a Command<a class="headerlink" href="#create-a-
504504
<span class="k">public</span> <span class="k">void</span> <span class="nf">Run</span><span class="p">()</span>
505505
<span class="p">{</span>
506506
<span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Hello, world!&quot;</span><span class="p">);</span>
507-
<span class="k">return</span> <span class="k">new</span> <span class="nf">void</span><span class="p">(</span><span class="k">true</span><span class="p">);</span>
508507
<span class="p">}</span>
509508
<span class="p">}</span>
510509
<span class="p">}</span>
@@ -523,7 +522,6 @@ <h2 id="create-a-command">Create a Command<a class="headerlink" href="#create-a-
523522
<span class="k">public</span> <span class="k">override</span> <span class="k">void</span> <span class="nf">Run</span><span class="p">()</span>
524523
<span class="p">{</span>
525524
<span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Hello, world!&quot;</span><span class="p">);</span>
526-
<span class="k">return</span> <span class="k">new</span> <span class="nf">void</span><span class="p">(</span><span class="k">true</span><span class="p">);</span>
527525
<span class="p">}</span>
528526
<span class="p">}</span>
529527
<span class="p">}</span>
@@ -663,7 +661,6 @@ <h2 id="logging">Logging<a class="headerlink" href="#logging" title="Permanent l
663661
<span class="n">Logger</span><span class="p">.</span><span class="n">Warn</span><span class="p">(</span><span class="s">&quot;Sample warning message&quot;</span><span class="p">);</span>
664662
<span class="n">Logger</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="s">&quot;Sample error message&quot;</span><span class="p">);</span>
665663
<span class="n">Logger</span><span class="p">.</span><span class="n">Fatal</span><span class="p">(</span><span class="s">&quot;Sample fatal error message&quot;</span><span class="p">);</span>
666-
<span class="k">return</span> <span class="k">new</span> <span class="nf">void</span><span class="p">(</span><span class="k">true</span><span class="p">);</span>
667664
<span class="p">}</span>
668665
</pre></div>
669666

@@ -700,8 +697,6 @@ <h2 id="progress-bar">Progress Bar<a class="headerlink" href="#progress-bar" tit
700697
<span class="c1">// Update the command&#39;s progress</span>
701698
<span class="n">UpdateProgress</span><span class="p">(</span><span class="n">i</span><span class="p">);</span>
702699
<span class="p">}</span>
703-
704-
<span class="k">return</span> <span class="k">new</span> <span class="nf">void</span><span class="p">(</span><span class="k">true</span><span class="p">);</span>
705700
<span class="p">}</span>
706701
</pre></div>
707702

docs/queuing/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,13 @@
384384

385385
</li>
386386

387+
<li class="md-nav__item">
388+
<a href="#message-compression" title="Message Compression" class="md-nav__link">
389+
Message Compression
390+
</a>
391+
392+
</li>
393+
387394

388395

389396
</ul>
@@ -518,6 +525,13 @@
518525

519526
</li>
520527

528+
<li class="md-nav__item">
529+
<a href="#message-compression" title="Message Compression" class="md-nav__link">
530+
Message Compression
531+
</a>
532+
533+
</li>
534+
521535

522536

523537
</ul>
@@ -606,6 +620,13 @@ <h2 id="primary-and-secondary-queue">Primary and Secondary Queue<a class="header
606620
<p>What about 3, 4, or 900 queues? Numerous queues gets to be a pain to manage and, practically speaking, is probably unnecessary.
607621
If it is desirable, different <a href="../configuration">configuration files</a> can be used to run multiple instances of InEngine.NET.
608622
Simply create a new config file with a new QueueName setting and point inengine.exe at it.</p>
623+
<h2 id="message-compression">Message Compression<a class="headerlink" href="#message-compression" title="Permanent link">&para;</a></h2>
624+
<p>Messages can be compressed when saved in the queue.
625+
It is important to understand the trade-offs of this feature before enabling it.
626+
Compressing messages takes more CPU resources and might negatively impact queueing throughput if the queued commands do not have a lot of internal state.
627+
Put simply, if the commands are too small to benefit from being compressed, then compressing them wastes resources.</p>
628+
<p>If the commands have a lot of internal state, then this feature will reduce the queue's memory consumption.
629+
Also, in a high-throughput scenario, where network bandwidth is limited, this feature can greatly reduce the amount of bandwidth used.</p>
609630

610631

611632

0 commit comments

Comments
 (0)