Fs2: Add support for unix sockets

Created on 20 Aug 2020  路  7Comments  路  Source: typelevel/fs2

Following this discussion on Gitter it appears feasible to add support for unix sockets to fs2 based on jnr-unixsockets.

As a use case example this could benefit a library like tpolecat/skunk to talk to a postgres database via unix sockets as it is done on Google Cloud (Run).

feature

Most helpful comment

Alright, going to contribute this as a new module to fs2 as long as everyone is happy.

All 7 comments

I think @ChristopherDavenport implemented this recently. I'd be happy to incorporate it in to fs2-io if Chris wants but knowing Chris, it's already available somewhere. :)

Always happy to get code off my hands though if you want it.

Otherwise I was going to move it into something like fs2-unixsocket or something to that effect here shortly. Was finishing ember to prove all my concepts work. But its pretty solid at communicating with the docker daemon already.

Alright, going to contribute this as a new module to fs2 as long as everyone is happy.

I don't have an immediate use for this, I was just investigating the topic and wanted to document the gitter discussion in the issues to provide a better point of reference for other people searching for this. Knowing that I can find a solution for this in the whaletail repo is totally sufficient for me, but having a proper fs2 module would certainly be a convenient solution.

Probably a very rare use-case, but the jnr-unixsocket library relies on https://github.com/jnr/jnr-ffi which makes use of dynamic class loading for platform-specific stuff, which breaks immediately when building with graalvm native-image (no fallback)

Also there's JEP effort to provide a generic solution in the JDK itself: https://openjdk.java.net/jeps/380 which hopefully won't rely on dynamic class loading, so should be more portable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rintcius picture rintcius  路  10Comments

mpilquist picture mpilquist  路  10Comments

gvolpe picture gvolpe  路  9Comments

mpilquist picture mpilquist  路  3Comments

mpilquist picture mpilquist  路  14Comments