__________               __
       ____    ____\\______   \\____  _______/  |_
      /    \\  / ___\\|     ___/  _ \\/  ___/\\   __\\
     |   |  \\/ /_/  >    |  (  <_> )___ \\  |  |
     |___|  /\\___  /|____|   \\____/____  > |__|
          \\//_____/                    \\/
                          v 5.0

NgPost started back in 2000 as a command line poster written in C++/Qt.
Its primary idea was to be fast, so it was written in C++ rather than interpreted languages.
Then, I made the assumption that encoding the articles could be time-consuming.
Using a pool of NNTP connections, the aim was thus to always have prepared articles ready for them, so they could post them straight away to Usenet (without no interuption, no computation).
NgPost is multi-thread and completely non blocking. (i.e: asynchronous with Qt event loop)
NgPost is fully opensource, available here on github.


Main architecture



some explanation of the diagram will arrive asap...


NntpConnections and PostingJobs



PostingJob are created and goes into the main thread event loop using mainly NgPost::startPostingJob
They will go either in NgPost::_activeJob or in the queue NgPost::_pendingJobs (or NgPost::_packingJob cf dedicated section)
They are started (in main Thread, where they live) by emitting this signal: void sigStartPosting(bool isActiveJob);
Here are its QueuedConnection connections:


    connect(this, &PostingJob::sigStartPosting,     this,     &PostingJob::onStartPosting);
    connect(this, &PostingJob::sigStopPosting,      this,     &PostingJob::onStopPosting);
    connect(this, &PostingJob::sigPostingStarted,   &_ngPost, &NgPost::onPostingJobStarted);
    connect(this, &PostingJob::sigPackingDone,      &_ngPost, &NgPost::onPackingDone);
    connect(this, &PostingJob::sigPostingFinished,  &_ngPost, &NgPost::onPostingJobFinished);
    connect(this, &PostingJob::sigNoMorePostingConnection, &_ngPost, &NgPost::onNoMorePostingConnection);

PostingJob do its job by himself and signal _ngPost when done.
It is using/holding mainly:

Number of Threads, who lives where? external Process?

1.: MainThread where live: NgPost, the PostingJob(s) and their Poster(s)
but also all NNTP::File(s) and their NNTP::Article(s)

2.: BuilderThread(s) and NntpThread(s) owned by Poster(s) where ArticleBuilder live in the first one and the NntpConnection(s) in the second.

3.: an extenal process is used asynchronously by PostingJob(s) when required for packing.

Everything is happening in a non blocking architecture (sockets, processes, producers/consumers...)
Disk access is ¿safely? multithreaded if there are several Posters.
Most Objects are independant: