Skip to content

Commit 6624aeb

Browse files
committed
renaming PlaybookState
1 parent b4aacb7 commit 6624aeb

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Sources/Formic/CommandOutput.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct CommandOutput: Sendable {
2424
}
2525
return String(data: stdErr, encoding: String.Encoding.utf8)
2626
}
27-
27+
2828
/// Create a new command output.
2929
/// - Parameters:
3030
/// - returnCode: The return code

Sources/Formic/Documentation.docc/Engine/PlaybookRunState.md renamed to Sources/Formic/Documentation.docc/Engine/PlaybookState.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ``PlaybookRunState``
1+
# ``PlaybookState``
22

33
## Topics
44

Sources/Formic/Engine/Engine.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
public actor Engine {
33
let clock: ContinuousClock
44
var playbooks: [Playbook.ID: Playbook]
5-
var states: [Playbook.ID: PlaybookRunState]
5+
var states: [Playbook.ID: PlaybookState]
66
var commandResults: [Host: [Command.ID: CommandExecutionResult]]
77
var runners: [Host: Task<Void, any Error>]
88

@@ -11,8 +11,8 @@ public actor Engine {
1111
/// You can request the state of a playbook by calling the ``status(_:)`` method
1212
/// or watch a stream of the command results as they process by reading the ``commandUpdates``
1313
/// stream.
14-
public nonisolated let playbookUpdates: AsyncStream<(Playbook.ID, PlaybookRunState)>
15-
let stateContinuation: AsyncStream<(Playbook.ID, PlaybookRunState)>.Continuation
14+
public nonisolated let playbookUpdates: AsyncStream<(Playbook.ID, PlaybookState)>
15+
let stateContinuation: AsyncStream<(Playbook.ID, PlaybookState)>.Continuation
1616

1717
/// An asynchronous stream of command execution results.
1818
public nonisolated let commandUpdates: AsyncStream<(CommandExecutionResult)>
@@ -27,7 +27,7 @@ public actor Engine {
2727
playbooks = [:]
2828

2929
// assemble the streams and continuations
30-
(playbookUpdates, stateContinuation) = AsyncStream.makeStream(of: (Playbook.ID, PlaybookRunState).self)
30+
(playbookUpdates, stateContinuation) = AsyncStream.makeStream(of: (Playbook.ID, PlaybookState).self)
3131
(commandUpdates, commandContinuation) = AsyncStream.makeStream(of: CommandExecutionResult.self)
3232
}
3333

Sources/Formic/Engine/PlaybookRunState.swift renamed to Sources/Formic/Engine/PlaybookState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The state of execution for a playbook.
2-
public enum PlaybookRunState: Sendable, Hashable, Codable {
2+
public enum PlaybookState: Sendable, Hashable, Codable {
33
/// The playbook is scheduled to run, but hasn't yet started.
44
///
55
/// This is the initial state.

Sources/Formic/Engine/PlaybookStatus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// A representation of the state of playbook execution.
22
public struct PlaybookStatus: Sendable, Hashable, Codable {
33
/// The state of the playbook.
4-
public let state: PlaybookRunState
4+
public let state: PlaybookState
55
/// The playbook declaration.
66
public let playbook: Playbook
77
/// A nested dictionary of all results for this playbook, keyed by host, then by command ID.

Tests/formicTests/EngineTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ func testPlaybookStateStream() async throws {
403403
.addSuccess(command: ["uname"], presentOutput: "Linux\n")
404404
.throwError(command: ["whoami"], errorToThrow: TestError.unknown(msg: "Process failed in something"))
405405

406-
let stateStream: AsyncStream<(Playbook.ID, PlaybookRunState)> = engine.playbookUpdates
406+
let stateStream: AsyncStream<(Playbook.ID, PlaybookState)> = engine.playbookUpdates
407407
var streamIterator = stateStream.makeAsyncIterator()
408408

409409
try await withDependencies { dependencyValues in

0 commit comments

Comments
 (0)