Skip to content

Commit 14f256d

Browse files
committed
Update docs
1 parent ce787c9 commit 14f256d

File tree

3 files changed

+78
-2
lines changed

3 files changed

+78
-2
lines changed

docs-src/server.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ When run as a service, InEngine runs scheduled commands in the background and ac
44

55
## Running the Server
66

7+
The server can be run in a variety of ways.
8+
79
### In the Foreground
810

911
Running the server from the CommandLine is useful for debugging or local development:
@@ -18,6 +20,34 @@ It can also be run on Mac and Linux with Mono via a shell wrapper script:
1820
./inengine -s
1921
```
2022

23+
### In ASP.NET
24+
25+
The server can be run in Global.asax.cs:
26+
27+
```c#
28+
using System.Web;
29+
using InEngine.Core;
30+
31+
namespace MyWeApp
32+
{
33+
public class Global : HttpApplication
34+
{
35+
public ServerHost ServerHost { get; set; }
36+
37+
protected void Application_Start()
38+
{
39+
ServerHost = new ServerHost();
40+
ServerHost.Start();
41+
}
42+
43+
protected void Application_End()
44+
{
45+
ServerHost.Dispose();
46+
}
47+
}
48+
}
49+
```
50+
2151
### On Windows as a Service
2252

2353
Run the **Install.ps1** PowerShell script in the InEngine directory to install the InEngine as a service.

docs/search/search_index.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
},
258258
{
259259
"location": "/server/",
260-
"text": "Server\n\n\nWhen run as a service, InEngine runs scheduled commands in the background and actively listens for commands to be queued.\n\n\nRunning the Server\n\n\nIn the Foreground\n\n\nRunning the server from the CommandLine is useful for debugging or local development:\n\n\ninengine.exe -s\n\n\n\n\n\nIt can also be run on Mac and Linux with Mono via a shell wrapper script:\n\n\n./inengine -s\n\n\n\n\n\nOn Windows as a Service\n\n\nRun the \nInstall.ps1\n PowerShell script in the InEngine directory to install the InEngine as a service. \nThe script needs to be run as an administrator. \nThe script will register the service at the location where the script is run - i.e. put the files where you want them installed before running the installation script.\n\n\nps Install.ps1\n\n\n\n\n\nSimply run the \nUninstall.ps1\n script with elevated permissions to remove the service.\n\n\nps Uninstall.ps1\n\n\n\n\n\nOn Linux with Supervisor\n\n\nSupervisor is a process control system for Linux. \nIt has extensive \ndocumentation\n, but the following should be enough to get started.\n\n\nInstalling Supervisor\n\n\nThis command installs Supervisor on Ubuntu:\n\n\nsudo apt-get install supervisor\n\n\n\n\n\nConfiguring Supervisor\n\n\nSupervisor configuration files are stored in the \n/etc/supervisor/conf.d\n directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called \n/etc/supervisor/conf.d/inengine-scheduler.conf\n. \n\n\n[program:inengine]\n\n\nprocess_name\n=\n%(program_name)s_%(process_num)02d\n\n\ndirectory\n=\n/path/to/inengine\n\n\ncommand\n=\nmono inengine.exe -s\n\n\nautostart\n=\ntrue\n\n\nautorestart\n=\ntrue\n\n\nuser\n=\nInEngine\n\n\nnumprocs\n=\n1\n\n\nredirect_stderr\n=\ntrue\n\n\nstdout_logfile\n=\n./inengine.log\n\n\n\n\n\n\nStarting Supervisor\n\n\nWhenever a configuration change happens to files in the Supervisor config files, Supervisor needs to be instructed to reload its configuration.\n\n\nsudo supervisorctl reread\nsudo supervisorctl update\n\n\n\n\n\nNow, simply start the server workers with the \nsupervisorctl\n program:\n\n\nsudo supervisorctl start inengine:*\n\n\n\n\n\nIn a Container with Docker\n\n\nInstall \nDocker\n first, then pull the \nethanhann/inengine\n image:\n\n\ndocker pull ethanhann/inengine:latest\n\n\n\n\n\nNow run the InEngine in server mode:\n\n\ndocker run --rm ethanhann/inengine -s",
260+
"text": "Server\n\n\nWhen run as a service, InEngine runs scheduled commands in the background and actively listens for commands to be queued.\n\n\nRunning the Server\n\n\nThe server can be run in a variety of ways.\n\n\nIn the Foreground\n\n\nRunning the server from the CommandLine is useful for debugging or local development:\n\n\ninengine.exe -s\n\n\n\n\n\nIt can also be run on Mac and Linux with Mono via a shell wrapper script:\n\n\n./inengine -s\n\n\n\n\n\nIn ASP.NET\n\n\nThe server can be run in Global.asax.cs:\n\n\nusing\n \nSystem.Web\n;\n\n\nusing\n \nInEngine.Core\n;\n\n\n\nnamespace\n \nMyWeApp\n\n\n{\n\n \npublic\n \nclass\n \nGlobal\n \n:\n \nHttpApplication\n\n \n{\n\n \npublic\n \nServerHost\n \nServerHost\n \n{\n \nget\n;\n \nset\n;\n \n}\n\n\n \nprotected\n \nvoid\n \nApplication_Start\n()\n\n \n{\n\n \nServerHost\n \n=\n \nnew\n \nServerHost\n();\n\n \nServerHost\n.\nStart\n();\n\n \n}\n\n\n \nprotected\n \nvoid\n \nApplication_End\n()\n\n \n{\n\n \nServerHost\n.\nDispose\n();\n\n \n}\n\n \n}\n\n\n}\n\n\n\n\n\n\nOn Windows as a Service\n\n\nRun the \nInstall.ps1\n PowerShell script in the InEngine directory to install the InEngine as a service. \nThe script needs to be run as an administrator. \nThe script will register the service at the location where the script is run - i.e. put the files where you want them installed before running the installation script.\n\n\nps Install.ps1\n\n\n\n\n\nSimply run the \nUninstall.ps1\n script with elevated permissions to remove the service.\n\n\nps Uninstall.ps1\n\n\n\n\n\nOn Linux with Supervisor\n\n\nSupervisor is a process control system for Linux. \nIt has extensive \ndocumentation\n, but the following should be enough to get started.\n\n\nInstalling Supervisor\n\n\nThis command installs Supervisor on Ubuntu:\n\n\nsudo apt-get install supervisor\n\n\n\n\n\nConfiguring Supervisor\n\n\nSupervisor configuration files are stored in the \n/etc/supervisor/conf.d\n directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called \n/etc/supervisor/conf.d/inengine-scheduler.conf\n. \n\n\n[program:inengine]\n\n\nprocess_name\n=\n%(program_name)s_%(process_num)02d\n\n\ndirectory\n=\n/path/to/inengine\n\n\ncommand\n=\nmono inengine.exe -s\n\n\nautostart\n=\ntrue\n\n\nautorestart\n=\ntrue\n\n\nuser\n=\nInEngine\n\n\nnumprocs\n=\n1\n\n\nredirect_stderr\n=\ntrue\n\n\nstdout_logfile\n=\n./inengine.log\n\n\n\n\n\n\nStarting Supervisor\n\n\nWhenever a configuration change happens to files in the Supervisor config files, Supervisor needs to be instructed to reload its configuration.\n\n\nsudo supervisorctl reread\nsudo supervisorctl update\n\n\n\n\n\nNow, simply start the server workers with the \nsupervisorctl\n program:\n\n\nsudo supervisorctl start inengine:*\n\n\n\n\n\nIn a Container with Docker\n\n\nInstall \nDocker\n first, then pull the \nethanhann/inengine\n image:\n\n\ndocker pull ethanhann/inengine:latest\n\n\n\n\n\nNow run the InEngine in server mode:\n\n\ndocker run --rm ethanhann/inengine -s",
261261
"title": "Server"
262262
},
263263
{
@@ -267,14 +267,19 @@
267267
},
268268
{
269269
"location": "/server/#running-the-server",
270-
"text": "",
270+
"text": "The server can be run in a variety of ways.",
271271
"title": "Running the Server"
272272
},
273273
{
274274
"location": "/server/#in-the-foreground",
275275
"text": "Running the server from the CommandLine is useful for debugging or local development: inengine.exe -s It can also be run on Mac and Linux with Mono via a shell wrapper script: ./inengine -s",
276276
"title": "In the Foreground"
277277
},
278+
{
279+
"location": "/server/#in-aspnet",
280+
"text": "The server can be run in Global.asax.cs: using System.Web ; using InEngine.Core ; namespace MyWeApp { \n public class Global : HttpApplication \n { \n public ServerHost ServerHost { get ; set ; } \n\n protected void Application_Start () \n { \n ServerHost = new ServerHost (); \n ServerHost . Start (); \n } \n\n protected void Application_End () \n { \n ServerHost . Dispose (); \n } \n } }",
281+
"title": "In ASP.NET"
282+
},
278283
{
279284
"location": "/server/#on-windows-as-a-service",
280285
"text": "Run the Install.ps1 PowerShell script in the InEngine directory to install the InEngine as a service. \nThe script needs to be run as an administrator. \nThe script will register the service at the location where the script is run - i.e. put the files where you want them installed before running the installation script. ps Install.ps1 Simply run the Uninstall.ps1 script with elevated permissions to remove the service. ps Uninstall.ps1",

docs/server/index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@
407407
In the Foreground
408408
</a>
409409

410+
</li>
411+
412+
<li class="md-nav__item">
413+
<a href="#in-aspnet" title="In ASP.NET" class="md-nav__link">
414+
In ASP.NET
415+
</a>
416+
410417
</li>
411418

412419
<li class="md-nav__item">
@@ -509,6 +516,13 @@
509516
In the Foreground
510517
</a>
511518

519+
</li>
520+
521+
<li class="md-nav__item">
522+
<a href="#in-aspnet" title="In ASP.NET" class="md-nav__link">
523+
In ASP.NET
524+
</a>
525+
512526
</li>
513527

514528
<li class="md-nav__item">
@@ -582,6 +596,7 @@
582596
<h1 id="server">Server<a class="headerlink" href="#server" title="Permanent link">&para;</a></h1>
583597
<p>When run as a service, InEngine runs scheduled commands in the background and actively listens for commands to be queued.</p>
584598
<h2 id="running-the-server">Running the Server<a class="headerlink" href="#running-the-server" title="Permanent link">&para;</a></h2>
599+
<p>The server can be run in a variety of ways.</p>
585600
<h3 id="in-the-foreground">In the Foreground<a class="headerlink" href="#in-the-foreground" title="Permanent link">&para;</a></h3>
586601
<p>Running the server from the CommandLine is useful for debugging or local development:</p>
587602
<div class="codehilite"><pre><span></span>inengine.exe -s
@@ -593,6 +608,32 @@ <h3 id="in-the-foreground">In the Foreground<a class="headerlink" href="#in-the-
593608
</pre></div>
594609

595610

611+
<h3 id="in-aspnet">In ASP.NET<a class="headerlink" href="#in-aspnet" title="Permanent link">&para;</a></h3>
612+
<p>The server can be run in Global.asax.cs:</p>
613+
<div class="codehilite"><pre><span></span><span class="k">using</span> <span class="nn">System.Web</span><span class="p">;</span>
614+
<span class="k">using</span> <span class="nn">InEngine.Core</span><span class="p">;</span>
615+
616+
<span class="k">namespace</span> <span class="nn">MyWeApp</span>
617+
<span class="p">{</span>
618+
<span class="k">public</span> <span class="k">class</span> <span class="nc">Global</span> <span class="p">:</span> <span class="n">HttpApplication</span>
619+
<span class="p">{</span>
620+
<span class="k">public</span> <span class="n">ServerHost</span> <span class="n">ServerHost</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
621+
622+
<span class="k">protected</span> <span class="k">void</span> <span class="nf">Application_Start</span><span class="p">()</span>
623+
<span class="p">{</span>
624+
<span class="n">ServerHost</span> <span class="p">=</span> <span class="k">new</span> <span class="n">ServerHost</span><span class="p">();</span>
625+
<span class="n">ServerHost</span><span class="p">.</span><span class="n">Start</span><span class="p">();</span>
626+
<span class="p">}</span>
627+
628+
<span class="k">protected</span> <span class="k">void</span> <span class="nf">Application_End</span><span class="p">()</span>
629+
<span class="p">{</span>
630+
<span class="n">ServerHost</span><span class="p">.</span><span class="n">Dispose</span><span class="p">();</span>
631+
<span class="p">}</span>
632+
<span class="p">}</span>
633+
<span class="p">}</span>
634+
</pre></div>
635+
636+
596637
<h3 id="on-windows-as-a-service">On Windows as a Service<a class="headerlink" href="#on-windows-as-a-service" title="Permanent link">&para;</a></h3>
597638
<p>Run the <strong>Install.ps1</strong> PowerShell script in the InEngine directory to install the InEngine as a service.
598639
The script needs to be run as an administrator.

0 commit comments

Comments
 (0)