Skip to content

Commit 47815b2

Browse files
committed
Deprecate old UnixSockets
1 parent 8a0df13 commit 47815b2

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

io/js/src/main/scala/fs2/io/net/unixsocket/UnixSocketsPlatform.scala

+4
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,20 @@ import cats.effect.{Async, IO, LiftIO}
2828
import fs2.io.file.Files
2929

3030
private[unixsocket] trait UnixSocketsCompanionPlatform { self: UnixSockets.type =>
31+
@deprecated("Use Network instead", "3.13.0")
3132
def forIO: UnixSockets[IO] = forLiftIO
3233

34+
@deprecated("Use Network instead", "3.13.0")
3335
implicit def forLiftIO[F[_]: Async: LiftIO]: UnixSockets[F] = {
3436
val _ = LiftIO[F]
3537
forAsyncAndFiles
3638
}
3739

40+
@deprecated("Use Network instead", "3.13.0")
3841
def forAsync[F[_]](implicit F: Async[F]): UnixSockets[F] =
3942
forAsyncAndFiles(Files.forAsync(F), F)
4043

44+
@deprecated("Use Network instead", "3.13.0")
4145
def forAsyncAndFiles[F[_]: Files](implicit F: Async[F]): UnixSockets[F] = {
4246
val _ = Files[F]
4347
new AsyncUnixSockets(UnixSocketsProvider.forAsync)

io/jvm/src/main/scala/fs2/io/net/unixsocket/UnixSocketsPlatform.scala

+4
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,22 @@ import cats.effect.{Async, IO, LiftIO}
2828
import fs2.io.file.Files
2929

3030
private[unixsocket] trait UnixSocketsCompanionPlatform { self: UnixSockets.type =>
31+
@deprecated("Use Network instead", "3.13.0")
3132
def forIO: UnixSockets[IO] = forLiftIO
3233

34+
@deprecated("Use Network instead", "3.13.0")
3335
implicit def forLiftIO[F[_]: Async: LiftIO]: UnixSockets[F] = {
3436
val _ = LiftIO[F]
3537
forAsyncAndFiles
3638
}
3739

40+
@deprecated("Use Network instead", "3.13.0")
3841
def forAsyncAndFiles[F[_]: Async: Files]: UnixSockets[F] = {
3942
val _ = Files[F]
4043
new AsyncUnixSockets(UnixSocketsProvider.forAsync)
4144
}
4245

46+
@deprecated("Use Network instead", "3.13.0")
4347
def forAsync[F[_]](implicit F: Async[F]): UnixSockets[F] =
4448
forAsyncAndFiles(F, Files.forAsync(F))
4549
}

io/native/src/main/scala/fs2/io/net/unixsocket/UnixSocketsPlatform.scala

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package unixsocket
2727
import cats.effect.{Async, LiftIO}
2828

2929
private[unixsocket] trait UnixSocketsCompanionPlatform { self: UnixSockets.type =>
30+
@deprecated("Use Network instead", "3.13.0")
3031
implicit def forLiftIO[F[_]: Async: LiftIO]: UnixSockets[F] =
3132
new AsyncUnixSockets(new FdPollingUnixSocketsProvider[F])
3233
}

io/shared/src/main/scala/fs2/io/net/unixsocket/UnixSockets.scala

+5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ import fs2.Stream
2929
import fs2.io.net.{Socket, SocketOption, UnixSocketsProvider}
3030

3131
/** Capability of working with AF_UNIX sockets. */
32+
@deprecated("Use client, bind, bindAndAccept on Network[F] instead", "3.13.0")
3233
trait UnixSockets[F[_]] {
3334

3435
/** Returns a resource which opens a unix socket to the specified path.
3536
*/
37+
@deprecated("Use Network[F].connect(address) instead", "3.13.0")
3638
def client(address: UnixSocketAddress): Resource[F, Socket[F]]
3739

3840
/** Listens to the specified path for connections and emits a `Socket` for each connection.
@@ -43,6 +45,7 @@ trait UnixSockets[F[_]] {
4345
*
4446
* By default, the path is deleted when the server closes. To override this, pass `deleteOnClose = false`.
4547
*/
48+
@deprecated("Use Network[F].bind(address) instead", "3.13.0")
4649
def server(
4750
address: UnixSocketAddress,
4851
deleteIfExists: Boolean = false,
@@ -51,8 +54,10 @@ trait UnixSockets[F[_]] {
5154
}
5255

5356
object UnixSockets extends UnixSocketsCompanionPlatform {
57+
@deprecated("Use Network[F] instead", "3.13.0")
5458
def apply[F[_]](implicit F: UnixSockets[F]): UnixSockets[F] = F
5559

60+
@deprecated("Use Network[F] instead", "3.13.0")
5661
protected class AsyncUnixSockets[F[_]: Async](delegate: UnixSocketsProvider[F])
5762
extends UnixSockets[F] {
5863

0 commit comments

Comments
 (0)