Re: [go-nuts] Creating a MQTT library

2021-09-19 Thread ben...@gmail.com
> Neither. Return a blocking iterator, something like > > type Iterator struct { > // Next blocks until a new message is available or the stream ends and > returns if a new message is available. > Next() bool > // Message returns the current message. Must only be called after Next

Re: [go-nuts] Creating a MQTT library

2021-09-17 Thread 'Axel Wagner' via golang-nuts
On Thu, Sep 16, 2021 at 11:17 PM yba...@gmail.com wrote: > - Design in a non-blocking tcp way (that is let the user use > select()/poll()/epoll() sycall). > - Or design it with blocking tcp io inside go routines, which would return > 2 channels (read and write). Then let the user do a

Re: [go-nuts] Creating a MQTT library

2021-09-16 Thread Robert Engels
The advantage of Go is to be able to use millions of blocking Go routines. Synchronous programming is much easier than async - especially for streaming protocols. > On Sep 16, 2021, at 4:17 PM, yba...@gmail.com wrote: > > Hello everyone, > > I am trying to design a new library to

[go-nuts] Creating a MQTT library

2021-09-16 Thread yba...@gmail.com
Hello everyone, I am trying to design a new library to encode/decode MQTT messages. I began the work, and now I must decide how to design the TCP processing of my library, and I am facing two choices: - Design in a non-blocking tcp way (that is let the user use select()/poll()/epoll() sycall).