Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NodeKit/NodeKit/Chains/ChainBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ open class URLChainBuilder<Route: URLRouteProvider>: ChainConfigBuilder, ChainBu
/// - Parameter root: The chain to which nodes will be added
open func metadataConnectorChain<O>(
root: any AsyncNode<TransportURLRequest, O>
) -> some AsyncNode<Json, O> {
) -> any AsyncNode<Json, O> {
let urlRequestEncodingNode = URLJsonRequestEncodingNode(next: root)
let urlRequestTrasformatorNode = URLRequestTrasformatorNode(next: urlRequestEncodingNode, method: method)
let requestEncoderNode = RequestEncoderNode(next: urlRequestTrasformatorNode, encoding: encoding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/// Combine subscription for ``AsyncNode``.
/// Contains base implementation, inheriting from `BaseSubscription`.
/// - Warning: There is small delay between `subscriber.receive(_ input` and `subscriber.receive(completion:` to make sure that input will be published in publisher before completion.
final class AsyncNodeSubscription<Node: AsyncNode, S: NodeSubscriber<Node>>:
BaseSubscription<AsyncNodeResultPublisher<Node>, S> {

Expand All @@ -30,6 +31,7 @@ final class AsyncNodeSubscription<Node: AsyncNode, S: NodeSubscriber<Node>>:
return Task {
let result = await node.process(input, logContext: logContext)
_ = subscriber.receive(result)
try? await Task.sleep(nanoseconds: 1_000_000)
subscriber.receive(completion: .finished)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open class VoidIONode: AsyncNode {

let next: any AsyncNode<Json, Json>

init(next: some AsyncNode<Json, Json>) {
public init(next: some AsyncNode<Json, Json>) {
self.next = next
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open class VoidOutputNode<Input>: AsyncNode where Input: DTOEncodable, Input.DTO

let next: any AsyncNode<Json, Json>

init(next: some AsyncNode<Json, Json>) {
public init(next: some AsyncNode<Json, Json>) {
self.next = next
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class ResponseDataParserNode: AsyncNode {
await parse(with: data, logContext: logContext)
.asyncFlatMap { json, logMessage in
let logMsg = logMessage + .lineTabDeilimeter
var log = LogChain(logMsg, id: objectName, logType: .info, order: LogOrder.responseDataParserNode)
let log = LogChain(logMsg, id: objectName, logType: .info, order: LogOrder.responseDataParserNode)

guard let next = next else {
await logContext.add(log)
Expand Down