User-defined functions¶
Refinery lets you write your own server-side functions. With these user-defined functions (UDFs), you can perform further logic on multiple API query result sets (e.g. join a getTicks return to a getStats return, then filter) before returning results to the client.
UDFs come in two varieties.
- Static UDFs
-
operate as ‘request/reply’ function calls or, from another perspective, how you would expect a traditional database query to operate. You execute the query (function call), wait while the query is executed and the system returns your result.
- Real-time UDFs
-
(RTUDFs) operate in a streaming fashion. They are called each and every time new data enters the system and they publish in real time. They are designed for high-performance real-time analytics and operate on a publish/subscribe (pub/sub) paradigm.
Setup involves defining functions and setting configuration parameters for them. The RTUDFs may be written in q or in Python.
Once set up, the results of these real-time UDFs flow through a standard tick-capture system, available for stream and persistence.
The data is accessed via
getUDFin the Server API.
Adding new functions¶
Youu can add new UDFs to the system and managed them with the