You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-src/commands.md
+82-58Lines changed: 82 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,8 @@ namespace MyCommandPlugin
44
44
}
45
45
```
46
46
47
-
Extending the **InEngine.Core.AbstractCommand** class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler.
47
+
A command that implements ICommand can be run directly or [queued](queuing), but it cannot be [scheduled](scheduling).
48
+
Extending the **InEngine.Core.AbstractCommand** class adds extra functionality, like a progress bar, and the ability to schedule the command using the scheduler.
48
49
Minimally, the Run method should be overridden.
49
50
50
51
```c#
@@ -63,12 +64,12 @@ namespace MyCommandPlugin
63
64
}
64
65
```
65
66
66
-
67
67
## Run a Command
68
68
69
69
Create a class that implements **InEngine.Core.IOptions** in the same assembly as the command class.
70
-
Add a VerbOptions attribute from the CommandLine namespace that defines the name of the command and optional help text.
71
-
The help text can be auto-generated from the attribute or manually specified in the GetUsage method.
70
+
Add a VerbOptions attribute, from the CommandLine namespace, that defines the name of the command.
71
+
Optional help text can also be specified in the VerbOption attribute.
72
+
The help text can be auto-generated from the attribute or manually specified in the GetUsage method if desired.
72
73
73
74
```c#
74
75
usingCommandLine;
@@ -93,20 +94,20 @@ namespace MyCommandPlugin
93
94
94
95
Download the InEngine binary distribution, from the [GitHub Releases](https://github.com/InEngine-NET/InEngine.NET/releases) page, that matches the version of the InEngine.Core package you included.
95
96
96
-
Copy your project's DLLs into the same directory as inengine.exe.
97
+
Copy your project's DLLs into the Plugins subdirectory included in the binary distribution.
98
+
Add your plugin to the ["Plugins" list in appsettings.config](configuration) at the root of the binary distribution.
97
99
98
-
Run your command...
100
+
Run your command:
99
101
100
102
```bash
101
103
inengine.exe -pMyCommandPlugin my-command
102
104
```
103
105
104
-
## Discover Command Plugins
106
+
## View Available Plugins
105
107
106
-
Run inengine.exe without any arguments to see a list of plugins.
108
+
Run inengine.exe without any arguments to see a list of plugins:
Messages can be compressed when saved in the queue.
99
109
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.
110
+
If the queued commands are too small to benefit from being compressed, then compressing them wastes resources.
111
+
Compressing messages takes more CPU resources and might negatively impact queue throughput if the queued commands do not have a lot of internal state.
102
112
103
113
If the commands have a lot of internal state, then this feature will reduce the queue's memory consumption.
104
114
Also, in a high-throughput scenario, where network bandwidth is limited, this feature can greatly reduce the amount of bandwidth used.
0 commit comments