Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send messages async #6

Closed
mribichich opened this issue Jan 11, 2017 · 3 comments
Closed

Send messages async #6

mribichich opened this issue Jan 11, 2017 · 3 comments

Comments

@mribichich
Copy link

Hi there, I think it would be great to have a possibility to send messages async. Maybe do it configurable.

Because right now you are sending the message inside a Task, but you are waiting on it to finish.

Which practically makes it sync.

# Serilog.Sinks.Graylog/Transport/Udp/UdpTransportClient.cs

        public void Send(byte[] payload)
        {            
            Task resultTask = Task.Run(() =>
            {
                using (var udpClient = new UdpClient())
                {
                    udpClient.SendAsync(payload, payload.Length, _target);
                }
            });
            resultTask.Wait();
        }

I would love to contribute to it. Maybe we could remove the wait or not according to configuration by user

thanks!

@daningalla
Copy link

+1 on this. Any consideration?

@whir1
Copy link
Contributor

whir1 commented Mar 1, 2017

I can do it, but after migate to new VS project files

@whir1 whir1 closed this as completed Mar 24, 2017
@whir1
Copy link
Contributor

whir1 commented Mar 24, 2017

implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants