cutelyst 4.9.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
UnixFork Class Referencefinal
Inheritance diagram for UnixFork:

Public Member Functions

 UnixFork (int process, int threads, bool setupSignals, QObject *parent=nullptr)
 
virtual bool continueMaster (int *exit=nullptr) override
 
bool createProcess (bool respawn)
 
void decreaseWorkerRespawn ()
 
virtual int exec (bool lazy, bool master) override
 
void handleSigChld ()
 
void handleSigHup ()
 
void handleSigInt ()
 
void handleSigTerm ()
 
int internalExec ()
 
virtual void killChild () override
 
void killChild (qint64 pid)
 
virtual void restart () override
 
virtual void terminateChild () override
 
void terminateChild (qint64 pid)
 
- Public Member Functions inherited from AbstractFork
 AbstractFork (QObject *parent=nullptr)
 
void installTouchReload ()
 
void removeTouchReload ()
 
void setTouchReload (const QStringList &paths)
 

Static Public Member Functions

static void chownSocket (const QString &filename, const QString &uidGid)
 
static int idealProcessCount ()
 
static int idealThreadCount ()
 
static bool setGidUid (const QString &gid, const QString &uid, bool noInitgroups)
 
static void setSched (Cutelyst::Server *wsgi, int workerId, int workerCore)
 
static bool setUmask (const QByteArray &valueStr)
 
static void stopWSGI (const QString &pidfile)
 

Additional Inherited Members

- Signals inherited from AbstractFork
void forked (int workerId)
 
void shutdown ()
 
- Protected Member Functions inherited from AbstractFork
void directoryChanged (const QString &path)
 
void fileChanged (const QString &path)
 

Detailed Description

Definition at line 27 of file unixfork.h.

Constructor & Destructor Documentation

◆ UnixFork()

UnixFork::UnixFork ( int process,
int threads,
bool setupSignals,
QObject * parent = nullptr )
explicit

Definition at line 49 of file unixfork.cpp.

◆ ~UnixFork()

UnixFork::~UnixFork ( )
override

Definition at line 59 of file unixfork.cpp.

Member Function Documentation

◆ chownSocket()

void UnixFork::chownSocket ( const QString & filename,
const QString & uidGid )
static

Definition at line 335 of file unixfork.cpp.

◆ continueMaster()

bool UnixFork::continueMaster ( int * exit = nullptr)
overridevirtual

When in MASTER mode this method is called, it should return true if Server::exec() should continue setting up the listening socked or exit with exit code

Implements AbstractFork.

Definition at line 66 of file unixfork.cpp.

◆ createProcess()

bool UnixFork::createProcess ( bool respawn)

Definition at line 131 of file unixfork.cpp.

◆ decreaseWorkerRespawn()

void UnixFork::decreaseWorkerRespawn ( )

Definition at line 155 of file unixfork.cpp.

◆ exec()

int UnixFork::exec ( bool lazy,
bool master )
overridevirtual

Start event loop, it's useful for doing trickery when forking

Implements AbstractFork.

Definition at line 72 of file unixfork.cpp.

◆ handleSigChld()

void UnixFork::handleSigChld ( )

Definition at line 487 of file unixfork.cpp.

◆ handleSigHup()

void UnixFork::handleSigHup ( )

Definition at line 441 of file unixfork.cpp.

◆ handleSigInt()

void UnixFork::handleSigInt ( )

Definition at line 456 of file unixfork.cpp.

◆ handleSigTerm()

void UnixFork::handleSigTerm ( )

Definition at line 448 of file unixfork.cpp.

◆ idealProcessCount()

int UnixFork::idealProcessCount ( )
static

Definition at line 419 of file unixfork.cpp.

◆ idealThreadCount()

int UnixFork::idealThreadCount ( )
static

Definition at line 430 of file unixfork.cpp.

◆ internalExec()

int UnixFork::internalExec ( )

Definition at line 111 of file unixfork.cpp.

◆ killChild() [1/2]

void UnixFork::killChild ( )
overridevirtual

Called when child process should be nicely killed

Implements AbstractFork.

Definition at line 172 of file unixfork.cpp.

References killChild().

Referenced by killChild().

◆ killChild() [2/2]

void UnixFork::killChild ( qint64 pid)

Definition at line 180 of file unixfork.cpp.

◆ restart()

void UnixFork::restart ( )
overridevirtual

Called to restart process when any of the watched paths changes

Implements AbstractFork.

Definition at line 99 of file unixfork.cpp.

References terminateChild().

◆ setGidUid()

bool UnixFork::setGidUid ( const QString & gid,
const QString & uid,
bool noInitgroups )
static

Definition at line 268 of file unixfork.cpp.

◆ setSched()

void UnixFork::setSched ( Cutelyst::Server * wsgi,
int workerId,
int workerCore )
static

Definition at line 550 of file unixfork.cpp.

◆ setUmask()

bool UnixFork::setUmask ( const QByteArray & valueStr)
static

Definition at line 219 of file unixfork.cpp.

◆ stopWSGI()

void UnixFork::stopWSGI ( const QString & pidfile)
static

Definition at line 200 of file unixfork.cpp.

◆ terminateChild() [1/2]

void UnixFork::terminateChild ( )
overridevirtual

Called when child process should be brutaly killed

Implements AbstractFork.

Definition at line 186 of file unixfork.cpp.

References terminateChild().

Referenced by restart(), and terminateChild().

◆ terminateChild() [2/2]

void UnixFork::terminateChild ( qint64 pid)

Definition at line 194 of file unixfork.cpp.