Comments (1)
if you add fork : =true
to settings of example module in build.sbt
this will go away. However this particular example doesn't work because our strict scalac option that detect dead code. Should look like below.
object TcpServer extends zio.App {
import zio._
import zio.duration._
import zio.keeper.transport._
val localEnvironment = ZIO.environment[zio.ZEnv] @@ enrichWith[Logging[String]](
new Slf4jLogger.Live {
override def formatMessage(msg: String): ZIO[Any, Nothing, String] =
ZIO.succeed(msg)
}
)
override def run(args: List[String]) =
localEnvironment >>> (for {
tcp <- tcp.tcpTransport(10.seconds, 10.seconds)
localHost <- InetAddress.localHost.orDie
publicAddress <- SocketAddress
.inetSocketAddress(localHost, 8010)
.orDie
console <- ZIO.environment[Console]
handler = (channel: ChannelOut) => {
for {
data <- channel.read
_ <- putStrLn(new String(data.toArray))
_ <- channel.send(data)
} yield ()
}.forever
.catchAll(ex => putStrLn("error: " + ex.msg))
.provide(console)
_ <- putStrLn("public address: " + publicAddress.toString())
_ <- bind(publicAddress)(handler)
.provide(tcp)
.use(ch => ZIO.never.ensuring(ch.close.ignore))
} yield ()).ignore.as(0)
}
from zio-keeper.
Related Issues (20)
- Upgrade ZIO to 1.0.0-RC17
- Upgrade to zio-nio 0.4.0 HOT 1
- Implement caching for transport HOT 2
- Implement InMemoryTransport HOT 5
- Clean the code HOT 6
- Add correlationId to message HOT 4
- Implement Membership layer using HyParView protocol
- Add UDP transport HOT 6
- Complete the SWIM implementation HOT 1
- Explore plumtree for broadcasts on top of hyparview HOT 1
- Failing tests HOT 5
- OOM when running example HOT 3
- Use STM.foreach_ wherever possible HOT 4
- Upgrade ZIO to 1.0.0-RC18 HOT 10
- Plumtree tree optimization
- HyParView: Missing Tests
- HyParView: e2e tests
- Integrate PeerSim into the project HOT 4
- Upgrade to ZIO 2.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zio-keeper.