Skip to content

Commit 0fe32a6

Browse files
committed
adding in more architecture detail
1 parent 3acbd91 commit 0fe32a6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Sources/Formic/Documentation.docc/FormicGoals.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,22 @@ Extending from that, API for a declarative that uses the basic "operator" patter
1313
- Swift 6 language mode (full concurrency safety)
1414
- macOS and Linux support
1515

16-
### High Level Architecture
16+
### Engine Architecture
17+
18+
``Engine`` is a Swift actor - a reference type that maintains some internal state. Its intentionally _not_ a public actor, for the purpose of allowing more than one to exist on a system.
19+
The idea is that an instance `Engine` is embedded into your CLI app, and it gives you the primary interface to run commands.
20+
21+
Output from commands are exposed via a logger, with the return values being structured data from the command invocations reporting success, failure, or exceptions.
22+
The general idea being that in your code, you'll assemble a list of commands, and hand that to the engine to do the work.
23+
If any command throws an exception, the playbook (list of commands) you've submitted will terminate.
24+
Commands conform to the ``Command`` protocol, and have a number of options to control how they react - including ignoring a failure or retrying on failure with a ``Backoff`` and ``Backoff/Strategy-swift.enum``.
25+
26+
The `Command` protocol is set up to allow anyone to create their own commands, and use them with this general framework.
27+
28+
Beyond the imperative command setup, I'd like to reach for declarative resources and systems that can manage themselves as much as possible.
29+
Those are defined through the ``Resource`` protocol, and variations that include stateful, singular, and collections of resources.
30+
31+
### High Level Architecture - Declarative Software Infrastructure
1732

1833
I want to do this with a declarative structure that has an idea of state, using a single-pass following the operator pattern:
1934

0 commit comments

Comments
 (0)