140 DoubleList idleThreadList;
141 DoubleList runningThreadList;
142 DoubleList pendingJobList;
170#define LThreadMgr_canRun(o) ! DoubleList_isEmpty(&(o)->idleThreadList)
179#define LThreadMgr_enableHttpPool(o, server) \
180 HttpServer_setThreadPoolIntf(server, (HttpCmdThreadPoolIntf*)o)
205 int threads, lua_State* L,
int allowCreate);
250int lGetStdSockOptions(lua_State* L,
int tabIx,
const char** intf,
253void lsharkssl_unlock(lua_State *L,SharkSsl* super);
254SharkSsl* lsharkssl_lock(
255 lua_State *L,
int tabIx,SharkSsl_Role role,SharkSsl* lockedShark);
257int pushCertificate(lua_State *L,
SoDispCon* con);
258int pushCiphers(lua_State *L,
SoDispCon* con);
259int calcTabSize(lua_State* L,
int ix,
BaBool query);
261char* extractTab(
const char* tab, lua_State* L,
int ix,
264#define HTTPCLIENT "HTTPCLIENT"
266#define toHttpClient(L,ix) (struct HttpClient*)luaL_checkudata(L,ix,HTTPCLIENT)
268#define BACERTSTORE "BACERTSTORE"
271#define toCertStore(L,ix) (SharkSslCertStore*)luaL_checkudata(L,ix,BACERTSTORE)
void balua_http(lua_State *L)
Install the httpc Lua bindings.
void balua_crypto(lua_State *L)
Install the crypto Lua bindings.
void balua_sharkssl(lua_State *L)
Install the SharkSSL Lua bindings.
void balua_luaio(lua_State *L)
Install the LuaIo Lua bindings.
void balua_tracelogger(lua_State *L, struct LThreadMgr *tmgr)
Install the TraceLogger Lua bindings.
void balua_socket(lua_State *L)
Install the socket Lua bindings.
void balua_forkpty(lua_State *L)
Install the forkpty Lua bindings.
void balua_relsocket(lua_State *L)
Notify registered coroutine sockets that the server is shutting down.
ThreadPriority
Portable priority choices, mapped to the target operating system.
Definition: ThreadLib.h:61
BA_API ThreadJob * ThreadJob_lcreate(size_t size, ThreadJob_LRun lrun)
Create a thread job designed to execute Lua code.
void(* ThreadJob_Run)(struct ThreadJob *tj, struct LThreadMgr *mgr)
Generic ThreadJob callback.
Definition: lxrc.h:118
struct ThreadJob ThreadJob
A thread job created by ThreadJob_create or ThreadJob_lcreate.
BA_API void LThreadMgr_constructor(LThreadMgr *o, HttpServer *server, ThreadPriority priority, int stackSize, int threads, lua_State *L, int allowCreate)
Initialize the thread pool and install ba.thread.
BA_API int LThreadMgr_run(LThreadMgr *o, ThreadJob *tj)
This function sends a thread job to an available idle thread, or queues the job if no threads are cur...
struct LThreadMgr LThreadMgr
The global instance created by C code or a dynamic instance created by ba.thread.create
BA_API void LThreadMgr_destructor(LThreadMgr *o)
This function terminates the Thread Pool and waits for all threads to stop before returning.
BA_API ThreadJob * ThreadJob_create(size_t size, ThreadJob_Run run)
Create a generic thread job.
void(* ThreadJob_LRun)(struct ThreadJob *tj, int msgh, struct LThreadMgr *mgr)
ThreadJob callback designed for calling Lua code using lua_pcall.
Definition: lxrc.h:130
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
A container for key/value pairs used when setting custom HTTP headers or URL encoded HTTP parameters.
Definition: HttpClient.h:90
Blocking HTTP/1.1 client with optional SharkSSL HTTPS support.
Definition: HttpClient.h:187
Worker-pool dispatch interface borrowed by HttpServer.
Definition: HttpCmdThreadPoolIntf.h:63
The Web Server.
Definition: HttpServer.h:3393
The global instance created by C code or a dynamic instance created by ba.thread.create
Definition: lxrc.h:138
lua_State * Lg
Global state.
Definition: lxrc.h:144
int runningThreads
Threads currently running.
Definition: lxrc.h:145
int pendingJobs
Jobs queued.
Definition: lxrc.h:146
HttpServer * server
The server object.
Definition: lxrc.h:143
int isDynamic
if created via ba.thread.create()
Definition: lxrc.h:147
int threads
number of threads
Definition: lxrc.h:150
Contains information about the physical socket connection.
Definition: SoDispCon.h:120
A thread job created by ThreadJob_create or ThreadJob_lcreate.
Definition: lxrc.h:157
lua_State * Lt
Borrowed Lua thread, valid only during the job callback.
Definition: lxrc.h:161