A month ago I announced the first pre-alpha release of tanya, a general purpose library with an event loop. After a month of almost every day work, I think I can make a second announcement.


The bad news is that most probably I'm stopping my development of the library. The good news is that almost everything is now merged into dlib by Timur Gafarov: https://github.com/gecko0307/dlib.

My first contribution to dlib was in May 2016 and I decided that I would profit from extending an existing library and I can say that I had only positive experience from the work with Timur.

* dlib uses manual memory management aswell.
* there containers I can use without developing my own.
* there are some modules like zlib and huffman algorithm implementation I will need later for a web server.

You can find the event loop in dlib.async. The most noticeable change since the first release is that I think I can say now that the event loop is now cross-platform. dlib.memory.mmappool (memory.ullocator before) works now under Windows as well. The event loop itself supports epoll (linux), kqueue (developed and tested on FreeBSD) and IOCP (Windows). Because I need for Windows different sockets, I created own socket implementation. Anyway the work with the event loop and the sockets is now much easier than in the first version. UDP is still isn't supported.

Basic error handling was added.

dlib has now a "crypto" branch aswell, where I'm working on a light weight TLS package.

Another thing is that I changed my mind about @nogc. I still don't rely on the GC, but I think now that my understanding of @nogc was completely wrong. I thought that the missing @nogc means "it uses GC". But it seems to mean only "it can use GC" and @nogc means "it never uses GC". So I go now with allocators and give the user of the library the chance to decide if he wants to use the GC or not.

Please understand that the async package is still very simple. But I'm working hard on it in my free time. In the next step I want ot adapt it to a web framework I've started before (https://github.com/caraus-ecms/caraus).

Echo server example with the new version:
import dlib.async;
import dlib.network.socket;

class EchoProtocol : TransmissionControlProtocol
    private DuplexTransport transport;

    void received(ubyte[] data)

    void connected(DuplexTransport transport)
        this.transport = transport;

    void disconnected(SocketException exception = null)

void main()
auto address = new InternetAddress("", cast(ushort) 8192);
    version (Windows)
auto sock = new OverlappedStreamSocket(AddressFamily.INET);
        auto sock = new StreamSocket(AddressFamily.INET);
        sock.blocking = false;


    auto io = new ConnectionWatcher(sock);



There is still no online documentation. But I almost ready to begin to test the event loop and publish "self-hosted" documentation based on it.
Like always I welcome any feedback ).

Reply via email to