Skip to main content

Hub

The hub consists of a stack of clients and scopes.

The SDK maintains two variables: The main hub (a global variable) and the current hub (a variable local to the current thread or execution context, also sometimes known as async local or context local).

Functions

new

Hub.new(
ClientClient,
ScopeScope
) → ()

Clone

Hub:Clone() → ()

GetCurrentHub

Hub:GetCurrentHub() → ()

CaptureEvent

Hub:CaptureEvent(
EventEvent,
HintHint
) → ()

CaptureMessage

Hub:CaptureMessage(
Messagestring,
LevelLevel
) → ()

CaptureException

Hub:CaptureException(ErrorMessagestring?) → ()

PushScope

Hub:PushScope() → ()

WithScope

unreleased
</>
Hub:WithScope() → ()

PopScope

unreleased
</>
Hub:PopScope() → ()

ConfigureScope

Hub:ConfigureScope(Callback(ScopeClass.Scope) → ()) → ()

GetClient

Hub:GetClient() → ()

BindClient

Hub:BindClient(ClientClient) → ()

UnbindClient

Hub:UnbindClient() → ()

StartSession

Hub:StartSession() → ()

EndSession

Hub:EndSession() → ()
Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "Client",
                    "desc": "",
                    "lua_type": "Client"
                },
                {
                    "name": "Scope",
                    "desc": "",
                    "lua_type": "Scope"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 26,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "Clone",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 33,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "GetCurrentHub",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 39,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "CaptureEvent",
            "desc": "",
            "params": [
                {
                    "name": "Event",
                    "desc": "",
                    "lua_type": "Event"
                },
                {
                    "name": "Hint",
                    "desc": "",
                    "lua_type": "Hint"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 47,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "CaptureMessage",
            "desc": "",
            "params": [
                {
                    "name": "Message",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "Level",
                    "desc": "",
                    "lua_type": "Level"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 61,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "CaptureException",
            "desc": "",
            "params": [
                {
                    "name": "ErrorMessage",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 73,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "PushScope",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 120,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "WithScope",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "unreleased": true,
            "source": {
                "line": 134,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "PopScope",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "unreleased": true,
            "source": {
                "line": 141,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "ConfigureScope",
            "desc": "",
            "params": [
                {
                    "name": "Callback",
                    "desc": "",
                    "lua_type": "(ScopeClass.Scope) -> ()"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 149,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "GetClient",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 158,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "BindClient",
            "desc": "",
            "params": [
                {
                    "name": "Client",
                    "desc": "",
                    "lua_type": "Client"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 165,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "UnbindClient",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 171,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "StartSession",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 177,
                "path": "src/Hub/init.lua"
            }
        },
        {
            "name": "EndSession",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 199,
                "path": "src/Hub/init.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Hub",
    "desc": "The hub consists of a stack of clients and scopes.\n\nThe SDK maintains two variables: The main hub (a global variable) and the current\nhub (a variable local to the current thread or execution context, also sometimes\nknown as async local or context local).",
    "source": {
        "line": 18,
        "path": "src/Hub/init.lua"
    }
}