@@ -710,12 +710,10 @@ public struct PostgresCopyFromWriter: Sendable {
710
710
}
711
711
712
712
private let channelHandler : NIOLoopBound < PostgresChannelHandler >
713
- private let context : NIOLoopBound < ChannelHandlerContext >
714
713
private let eventLoop : any EventLoop
715
714
716
- init ( handler: PostgresChannelHandler , context : ChannelHandlerContext , eventLoop: any EventLoop ) {
715
+ init ( handler: PostgresChannelHandler , eventLoop: any EventLoop ) {
717
716
self . channelHandler = NIOLoopBound ( handler, eventLoop: eventLoop)
718
- self . context = NIOLoopBound ( context, eventLoop: eventLoop)
719
717
self . eventLoop = eventLoop
720
718
}
721
719
@@ -728,20 +726,20 @@ public struct PostgresCopyFromWriter: Sendable {
728
726
// error during the data transfer and thus cannot process any more data.
729
727
try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , any Error > ) in
730
728
if eventLoop. inEventLoop {
731
- self . channelHandler. value. waitForWritableBuffer ( context : self . context . value , continuation)
729
+ self . channelHandler. value. waitForWritableBuffer ( continuation)
732
730
} else {
733
731
eventLoop. execute {
734
- self . channelHandler. value. waitForWritableBuffer ( context : self . context . value , continuation)
732
+ self . channelHandler. value. waitForWritableBuffer ( continuation)
735
733
}
736
734
}
737
735
}
738
736
739
737
// Run the actual data transfer
740
738
if eventLoop. inEventLoop {
741
- self . channelHandler. value. copyData ( byteBuffer, context : self . context . value )
739
+ self . channelHandler. value. copyData ( byteBuffer)
742
740
} else {
743
741
eventLoop. execute {
744
- self . channelHandler. value. copyData ( byteBuffer, context : self . context . value )
742
+ self . channelHandler. value. copyData ( byteBuffer)
745
743
}
746
744
}
747
745
}
@@ -751,10 +749,10 @@ public struct PostgresCopyFromWriter: Sendable {
751
749
func done( ) async throws {
752
750
try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , any Error > ) in
753
751
if eventLoop. inEventLoop {
754
- self . channelHandler. value. sendCopyDone ( continuation: continuation, context : self . context . value )
752
+ self . channelHandler. value. sendCopyDone ( continuation: continuation)
755
753
} else {
756
754
eventLoop. execute {
757
- self . channelHandler. value. sendCopyDone ( continuation: continuation, context : self . context . value )
755
+ self . channelHandler. value. sendCopyDone ( continuation: continuation)
758
756
}
759
757
}
760
758
}
@@ -765,10 +763,10 @@ public struct PostgresCopyFromWriter: Sendable {
765
763
func failed( error: any Error ) async throws {
766
764
try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , any Error > ) in
767
765
if eventLoop. inEventLoop {
768
- self . channelHandler. value. sendCopyFailed ( message: " \( error) " , continuation: continuation, context : self . context . value )
766
+ self . channelHandler. value. sendCopyFailed ( message: " \( error) " , continuation: continuation)
769
767
} else {
770
768
eventLoop. execute {
771
- self . channelHandler. value. sendCopyFailed ( message: " \( error) " , continuation: continuation, context : self . context . value )
769
+ self . channelHandler. value. sendCopyFailed ( message: " \( error) " , continuation: continuation)
772
770
}
773
771
}
774
772
}
@@ -777,10 +775,10 @@ public struct PostgresCopyFromWriter: Sendable {
777
775
/// Send a `Sync` message to the backend.
778
776
func sync( ) {
779
777
if eventLoop. inEventLoop {
780
- self . channelHandler. value. sendSync ( context : self . context . value )
778
+ self . channelHandler. value. sendSync ( )
781
779
} else {
782
780
eventLoop. execute {
783
- self . channelHandler. value. sendSync ( context : self . context . value )
781
+ self . channelHandler. value. sendSync ( )
784
782
}
785
783
}
786
784
}
0 commit comments