set-app
Purpose: Set process data.
set-app process-data <data>
set-app sets information related to an application or a process that runs it. A process may handle one or more requests, hence such data is cross-request and process-wide in scope. Some of this information is used by Vely and some is used by you in your code.
If you wish to set up
global_process_data, you can do so by providing <data> in the "process-data" clause, which is a pointer to any type. Internally, this pointer is saved as void*, so it can be cast to anything. <data> can be retrieved later anywhere in any request served by the process with
get-app (see "process-data" clause).
Process data has to be unmanaged memory because it is available across requests, see
memory_handling.
Examples
To set global process data, for instance in _startup.vely (i.e. in
startup_handler):
my_type *mydata;
manage-memory off
new-mem mydata size sizeof(my_type)
manage-memory on
set-app process-data mydata
See
global_process_data for more details and an example.
See also
Application information (
get-app set-app )
SEE ALL (
documentation)