Browse Source

Fix minor wordings

pull/988/head
Hsu Still 7 years ago
parent
commit
7c2ead8464
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
2 changed files with 8 additions and 7 deletions
  1. +2
    -1
      docs/faq/commands/Commands.md
  2. +6
    -6
      docs/guides/commands/post-execution.md

+ 2
- 1
docs/faq/commands/Commands.md View File

@@ -118,7 +118,8 @@ the [DefaultRunMode] flag under `CommandServiceConfig`.
[Task.Run], essentially making `ExecuteAsyncInternalAsync`, the task
that is used to invoke the command task, to be finished on a
different thread. This means that [ExecuteAsync] will be forced to
return a successful [ExecuteResult] regardless of the execution.
return a successful [ExecuteResult] regardless of the actual
execution result.

The following are the known caveats with `RunMode.Async`,



+ 6
- 6
docs/guides/commands/post-execution.md View File

@@ -28,10 +28,10 @@ handler. This could lead to messy code and has another potential
issue, working with `RunMode.Async`.

If your command is marked with `RunMode.Async`, [ExecuteAsync] will
return a successful [ExecuteResult] instead of whatever results
the actual command may return. Because of the way `RunMode.Async`
[works](xref:FAQ.Commands), handling within the command handler
may not always achieve the desired effect.
**always** return a successful [ExecuteResult] instead of whatever
results the actual command may return. Because of the way
`RunMode.Async` [works](xref:FAQ.Commands), handling within the
command handler may not always achieve the desired effect.

## CommandExecuted Event

@@ -43,7 +43,7 @@ used to streamline your post-execution design, and the best thing
about this event is that it is not prone to `RunMode.Async`'s
[ExecuteAsync] drawbacks.

With that in mind, we can begin working on code such as:
Thus, we can begin working on code such as:

[!code[CommandExecuted demo](samples/command_executed_demo.cs)]

@@ -84,7 +84,7 @@ After you're done creating your own [RuntimeResult], you can
implement it in your command by marking its return type to
`Task<RuntimeResult>`.

> ![NOTE]
> [!NOTE]
> You must mark the return type as `Task<RuntimeResult>` instead of
> `Task<MyCustomResult>`. Only the former will be picked up when
> building the module.


Loading…
Cancel
Save