cutelyst 5.0.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)
 
virtual bool continueMaster (int *exit=nullptr)=0
 
virtual int exec (bool lazy, bool master)=0
 
void installTouchReload ()
 
virtual void killChild ()=0
 
void removeTouchReload ()
 
virtual void restart ()=0
 
void setTouchReload (const QStringList &paths)
 
virtual void terminateChild ()=0
 

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 331 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 129 of file unixfork.cpp.

◆ decreaseWorkerRespawn()

void UnixFork::decreaseWorkerRespawn ( )

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

◆ handleSigHup()

void UnixFork::handleSigHup ( )

Definition at line 437 of file unixfork.cpp.

◆ handleSigInt()

void UnixFork::handleSigInt ( )

Definition at line 452 of file unixfork.cpp.

◆ handleSigTerm()

void UnixFork::handleSigTerm ( )

Definition at line 444 of file unixfork.cpp.

◆ idealProcessCount()

int UnixFork::idealProcessCount ( )
static

Definition at line 415 of file unixfork.cpp.

◆ idealThreadCount()

int UnixFork::idealThreadCount ( )
static

Definition at line 426 of file unixfork.cpp.

◆ internalExec()

int UnixFork::internalExec ( )

Definition at line 109 of file unixfork.cpp.

◆ killChild() [1/2]

void UnixFork::killChild ( )
overridevirtual

Called when child process should be nicely killed

Implements AbstractFork.

Definition at line 168 of file unixfork.cpp.

References killChild().

Referenced by killChild().

◆ killChild() [2/2]

void UnixFork::killChild ( qint64  pid)

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

◆ setSched()

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

Definition at line 544 of file unixfork.cpp.

◆ setUmask()

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

Definition at line 215 of file unixfork.cpp.

◆ stopWSGI()

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

Definition at line 196 of file unixfork.cpp.

◆ terminateChild() [1/2]

void UnixFork::terminateChild ( )
overridevirtual

Called when child process should be brutaly killed

Implements AbstractFork.

Definition at line 182 of file unixfork.cpp.

References terminateChild().

Referenced by restart(), and terminateChild().

◆ terminateChild() [2/2]

void UnixFork::terminateChild ( qint64  pid)

Definition at line 190 of file unixfork.cpp.