cutelyst 5.0.1
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 *server, int workerId, int workerCore)
 
static bool setUmask (const QByteArray &valueStr)
 
static void stopSERVER (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 51 of file unixfork.cpp.

◆ ~UnixFork()

UnixFork::~UnixFork ( )
override

Definition at line 61 of file unixfork.cpp.

Member Function Documentation

◆ chownSocket()

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

Definition at line 333 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 68 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 74 of file unixfork.cpp.

◆ handleSigChld()

void UnixFork::handleSigChld ( )

Definition at line 482 of file unixfork.cpp.

◆ handleSigHup()

void UnixFork::handleSigHup ( )

Definition at line 436 of file unixfork.cpp.

◆ handleSigInt()

void UnixFork::handleSigInt ( )

Definition at line 451 of file unixfork.cpp.

◆ handleSigTerm()

void UnixFork::handleSigTerm ( )

Definition at line 443 of file unixfork.cpp.

◆ idealProcessCount()

int UnixFork::idealProcessCount ( )
static

Definition at line 414 of file unixfork.cpp.

◆ idealThreadCount()

int UnixFork::idealThreadCount ( )
static

Definition at line 425 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 170 of file unixfork.cpp.

References killChild().

Referenced by killChild().

◆ killChild() [2/2]

void UnixFork::killChild ( qint64 pid)

Definition at line 178 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 101 of file unixfork.cpp.

References terminateChild().

◆ setGidUid()

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

Definition at line 266 of file unixfork.cpp.

◆ setSched()

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

Definition at line 543 of file unixfork.cpp.

◆ setUmask()

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

Definition at line 217 of file unixfork.cpp.

◆ stopSERVER()

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

Definition at line 198 of file unixfork.cpp.

◆ terminateChild() [1/2]

void UnixFork::terminateChild ( )
overridevirtual

Called when child process should be brutaly killed

Implements AbstractFork.

Definition at line 184 of file unixfork.cpp.

References terminateChild().

Referenced by restart(), and terminateChild().

◆ terminateChild() [2/2]

void UnixFork::terminateChild ( qint64 pid)

Definition at line 192 of file unixfork.cpp.