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: Sources/Formic/Documentation.docc/FormicGoals.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,22 @@ Extending from that, API for a declarative that uses the basic "operator" patter
13
13
- Swift 6 language mode (full concurrency safety)
14
14
- macOS and Linux support
15
15
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
17
32
18
33
I want to do this with a declarative structure that has an idea of state, using a single-pass following the operator pattern:
0 commit comments