Language plugins should expose the following api. Each language has its conventions, limits and strength's point.
When porting the api to a specific language try to be friendly to the language style.
This is the "official" list of functions exposed by the uWSGI api, functions not appearing here are not standardized so they could change their semanthics in future uWSGI relases.
The syntax proposed here is a pseudo-python, each language will expose each function with its specific style
When not_defined is used, it means the language-specific NULL representation (like None in python or undef in perl)
raise the specified uwsgi signal
register the function "func" as an RPC one with the specified "name"
argc will force the accepted number of arguments
uwsgi.rpc(node, name, *args)
call the uWSGI RPC function "name" on server "node" with the supplied args (if any)
if node is not_defined a "local" RPC will be made
uwsgi.call(name, *args)
call the uWSGI RPC function "name" locally with the supplied args (if any)
get "key" from the specified "cache". If "cache" is not_defined, the default local cache will be used.
To get an item from a remote cache use the cachename@addr:port syntax for the "cache" value
returns not_defined if the item is not found or an error has occurred
register a timer raising "signum" every "secs"
register a redblack timer raising "signum" every "secs"
acquire the specified user lock
release the specified user lock
return the current pid of the master process
raise the specified "alarm" with the message "msg"
suspend the current async core and give cpu to the next core in the schedule chain
suspend the current async core for the specified number of seconds
(requires uwsgi.suspend() or form of "yield" to be committed)
returns the file descriptor of the connection opened with the client
returns the file descriptor of a non-blocking connection to the specified "addr"
will raise an exception on error
(requires uwsgi.suspend() or form of "yield" to be committed)
will raise an exception on error
(requires uwsgi.suspend() or form of "yield" to be committed)
will raise an exception on error
after resume from suspend() returns the currently available file descriptor or -1 if a timeout was the cause of resume
send the specified "data" to the file descriptor "fd".
If "fd" is not specified the output of uwsgi.connection_fd() will be used
The position of arguments is a bit strange, but allows easier integration with POSIX write()
receive at most "len" bytes from the specified "fd"
If "fd" is not specified the output of uwsgi.connection_fd() will be used
The position of arguments is a bit strange, but allows easier integration with POSIX read()
close the specified file descriptor
set the name of the calling process
register a cron raising the uwsgi signal "signum"
disconnect the client without stopping the request handler
returns the current worker id (as integer).
0 means the calling process is not a worker
returns the current mule id (as integer).
0 means the calling process is not a mule
check if "signum" is registered
returns boolean
This is a hash/dictionary of all the specified options for the instance (both registered and virtuals)
the uWSGI version string
the server hostname
register the uwsgi signal "signum" of the specified "kind" mapped to "handler"
raise an Exception on error
set the user harakiri (for workers, mules and spoolers).
A value of 0, reset the timer