Show raw api
{
"functions": [
{
"name": "isReady",
"desc": "Checks whether the Result of a Poll is ready.\n```lua\nlocal poll = future:poll()\nif poll:isReady() then\n\tlocal result = poll:unwrap()\n\t-- ...\nend\n```\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean\r\n"
}
],
"function_type": "method",
"source": {
"line": 55,
"path": "src/Poll.luau"
}
},
{
"name": "isPending",
"desc": "Checks whether the Result of a Poll is pending.\n```lua\nlocal poll = future:poll()\nif poll:isPending() then\n\tcontinue\nend\n```\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "boolean\r\n"
}
],
"function_type": "method",
"source": {
"line": 68,
"path": "src/Poll.luau"
}
},
{
"name": "unwrap",
"desc": "Checks whether the Result of a Poll is ready.\n```lua\nlocal poll = future:poll()\nif poll:isReady() then\n\tlocal result = poll:unwrap()\n\t-- ...\nelse\n\tlocal result = poll:unwrap() --! Errors\n\t-- Error: Attempt to unwrap a pending future\nend\n```\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Result<E, U...>\r\n"
}
],
"function_type": "method",
"errors": [
{
"lua_type": "Attempt to unwrap a pending future",
"desc": "To prevent this, use Poll:isReady() or Future:await() to ensure the Result is ready."
}
],
"source": {
"line": 86,
"path": "src/Poll.luau"
}
},
{
"name": "ok",
"desc": "Creates a Poll with an `Ok` result.\r",
"params": [
{
"name": "...",
"desc": "",
"lua_type": "U..."
}
],
"returns": [
{
"desc": "",
"lua_type": "Poll<never, U...>\r\n"
}
],
"function_type": "static",
"source": {
"line": 101,
"path": "src/Poll.luau"
}
},
{
"name": "err",
"desc": "Creates a Poll with an `Err` result.\r",
"params": [
{
"name": "errValue",
"desc": "",
"lua_type": "E"
}
],
"returns": [
{
"desc": "",
"lua_type": "Poll<E, never>\r\n"
}
],
"function_type": "static",
"source": {
"line": 114,
"path": "src/Poll.luau"
}
},
{
"name": "notReady",
"desc": "Creates a Poll which status is not ready.\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Poll<never, never>\r\n"
}
],
"function_type": "static",
"source": {
"line": 127,
"path": "src/Poll.luau"
}
}
],
"properties": [],
"types": [],
"name": "Poll",
"desc": "A Poll represents the status of a [Result],\nwhether that result is Ready or Pending.\n```lua\nlocal poll = Poll.ok(...)\nif poll:isReady() then\n\tlocal result = poll:unwrap()\n\t-- ...\nelseif poll:isPending() then\n\t-- ...\nend\n```\r",
"source": {
"line": 25,
"path": "src/Poll.luau"
}
}