akka-stream-netty


Лицензия

Лицензия

Категории

Категории

Сеть Netty Networking Akka Контейнер Микросервисы Reactive libraries
Группа

Группа

com.github.zhongl
Идентификатор

Идентификатор

akka-stream-netty_2.12
Последняя версия

Последняя версия

0.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

akka-stream-netty
akka-stream-netty
Ссылка на сайт

Ссылка на сайт

https://github.com/zhongl/akka-stream-netty
Организация-разработчик

Организация-разработчик

com.github.zhongl
Система контроля версий

Система контроля версий

https://github.com/zhongl/akka-stream-netty

Скачать akka-stream-netty_2.12

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.zhongl/akka-stream-netty_2.12/ -->
<dependency>
    <groupId>com.github.zhongl</groupId>
    <artifactId>akka-stream-netty_2.12</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.zhongl/akka-stream-netty_2.12/
implementation 'com.github.zhongl:akka-stream-netty_2.12:0.1.2'
// https://jarcasting.com/artifacts/com.github.zhongl/akka-stream-netty_2.12/
implementation ("com.github.zhongl:akka-stream-netty_2.12:0.1.2")
'com.github.zhongl:akka-stream-netty_2.12:jar:0.1.2'
<dependency org="com.github.zhongl" name="akka-stream-netty_2.12" rev="0.1.2">
  <artifact name="akka-stream-netty_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.zhongl', module='akka-stream-netty_2.12', version='0.1.2')
)
libraryDependencies += "com.github.zhongl" % "akka-stream-netty_2.12" % "0.1.2"
[com.github.zhongl/akka-stream-netty_2.12 "0.1.2"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.scala-lang : scala-library jar 2.12.12
org.scoverage : scalac-scoverage-runtime_2.12 jar 1.4.1

Модули Проекта

Данный проект не имеет модулей.

CI Release Coveralls github Codacy Badge Maven Central

akka-stream-netty is a scala lib to adapt netty transport to akka-stream, which let us can use native transport with:

  • epoll
  • kqueue
  • unix domain socket

alpakka-unix-domain-socket would be a alternative if you only want to use unix domain socket.

Dependencies

libraryDependencies += "com.github.zhongl" %% "akka-stream-netty-all" % <latest tag>

Usage

import java.net._
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl._
import akka.util.ByteString
import io.netty.channel.socket._
import zhongl.stream.netty._
import all._

implicit val system = ActorSystem("demo")
implicit val mat = ActorMaterializer()
implicit val ec = system.dispatcher

Netty().bindAndHandle[ServerSocketChannel](Flow[ByteString].map(identity), new InetSocketAddress("localhost", 8080)).flatMap { sb =>
  Source.repeat(ByteString("a"))
    .delay(1.seconds) 
    .via(Netty().outgoingConnection[SocketChannel](sb.localAddress))
    .runForeach(println)
    .flatMap(_ => sb.unbind())    
}

More usage information please see test cases.

Версии библиотеки

Версия
0.1.2