Skip to content

Commit

Permalink
Merge pull request #2582 from armanbilge/topic/ClosedChannelException
Browse files Browse the repository at this point in the history
Introduce `fs2.io.ClosedChannelException`
  • Loading branch information
mpilquist authored Sep 10, 2021
2 parents 91938ac + 00d15b9 commit f537af0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions io/js/src/main/scala/fs2/io/IOException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ object IOException {
.orElse(FileSystemException.unapply(cause))
.orElse(UnknownHostException.unapply(cause))
}

class ClosedChannelException extends IOException
1 change: 1 addition & 0 deletions io/jvm/src/main/scala/fs2/io/ioplatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import fs2.io.internal.PipedStreamBuffer
import java.io.{InputStream, OutputStream}

private[fs2] trait ioplatform {
type ClosedChannelException = java.nio.channels.ClosedChannelException

/** Pipe that converts a stream of bytes to a stream that will emit a single `java.io.InputStream`,
* that is closed whenever the resulting stream terminates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ package net

import java.net.InetSocketAddress
import java.nio.{Buffer, ByteBuffer}
import java.nio.channels.{
CancelledKeyException,
ClosedChannelException,
DatagramChannel,
SelectionKey,
Selector
}
import java.nio.channels.{CancelledKeyException, DatagramChannel, SelectionKey, Selector}
import java.util.ArrayDeque
import java.util.concurrent.{ConcurrentLinkedQueue, CountDownLatch}
import java.util.concurrent.atomic.AtomicLong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package io
package net

import java.net.{InetSocketAddress, NetworkInterface}
import java.nio.channels.{ClosedChannelException, DatagramChannel}
import java.nio.channels.DatagramChannel

import cats.effect.kernel.{Async, Resource}
import cats.syntax.all._
Expand Down

0 comments on commit f537af0

Please sign in to comment.