Skip to content

Using Akka.DotNet.Streams to answer HTTP POST #6246

Discussion options

You must be logged in to vote

@tiago-andrade-dvs

var actorSystem = ActorSystem.Create("AkkaStreams", @"akka.loglevel = DEBUG");
var materializer = actorSystem.Materializer();

Source<Tcp.IncomingConnection, Task<Tcp.ServerBinding>> connections = actorSystem.TcpStream().Bind("127.0.0.1", 8888);

var (serverBind, source) = connections.PreMaterialize(materializer);

var sourceTask = source.RunForeach(connection =>
{
    Console.WriteLine($"New connection from: {connection.RemoteAddress}");

    Flow<ByteString, ByteString, Akka.NotUsed> flShape = Flow.FromGraph(
        GraphDsl.Create(b =>
        {
            var httpReceiver = Flow.Create<ByteString>()
                .Select(c =>
                {
                    

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@tiago-andrade-dvs
Comment options

@Aaronontheweb
Comment options

Comment options

You must be logged in to vote
2 replies
@tiago-andrade-dvs
Comment options

@Arkatufus
Comment options

Answer selected by tiago-andrade-dvs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants