Skip to content

Commit

Permalink
* rename KafkaProducer.StateMachine.State.shutDown to .finished
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschlegel committed Jun 28, 2023
1 parent 82e183a commit 07bda4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/SwiftKafka/KafkaProducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ extension KafkaProducer {
logger: Logger
)
/// The ``KafkaProducer`` has been shut down and cannot be used anymore.
case shutDown
case finished
}

/// The current state of the StateMachine.
Expand Down Expand Up @@ -416,7 +416,7 @@ extension KafkaProducer {
fatalError("\(#function) invoked while still in state \(self.state)")
case .started(let client, _, _, _, _):
return .poll(client: client)
case .shutDown:
case .finished:
return .killPollLoop
}
}
Expand All @@ -443,7 +443,7 @@ extension KafkaProducer {
} else {
return .createTopicHandle(client: client, topic: topic)
}
case .shutDown:
case .finished:
throw KafkaError.connectionClosed(reason: "Tried to create topic handle on closed connection")
}
}
Expand All @@ -466,7 +466,7 @@ extension KafkaProducer {
topicHandles: topicHandles,
logger: logger
)
case .shutDown:
case .finished:
throw KafkaError.connectionClosed(reason: "Tried to create topic handle on closed connection")
}
}
Expand Down Expand Up @@ -502,7 +502,7 @@ extension KafkaProducer {
client: client,
newMessageID: newMessageID
)
case .shutDown:
case .finished:
throw KafkaError.connectionClosed(reason: "Tried to produce a message with a closed producer")
}
}
Expand Down Expand Up @@ -530,13 +530,13 @@ extension KafkaProducer {
case .uninitialized:
fatalError("\(#function) invoked while still in state \(self.state)")
case .started(let client, _, let source, let topicHandles, _):
self.state = .shutDown
self.state = .finished
return .shutdownGracefullyAndFinishSource(
client: client,
source: source,
topicHandles: topicHandles
)
case .shutDown:
case .finished:
return nil
}
}
Expand Down

0 comments on commit 07bda4b

Please sign in to comment.