1133 lines
110 KiB
HTML
1133 lines
110 KiB
HTML
|
<?xml version="1.0" encoding="utf-8" ?>
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<!-- This file is generated by Nim. -->
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
||
|
<!-- Favicon -->
|
||
|
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
||
|
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
||
|
|
||
|
<!-- Google fonts -->
|
||
|
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
||
|
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
||
|
|
||
|
<!-- CSS -->
|
||
|
<title>chronos/internal/asyncengine</title>
|
||
|
<link rel="stylesheet" type="text/css" href="../../nimdoc.out.css">
|
||
|
|
||
|
<script type="text/javascript" src="../../dochack.js"></script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
function main() {
|
||
|
var pragmaDots = document.getElementsByClassName("pragmadots");
|
||
|
for (var i = 0; i < pragmaDots.length; i++) {
|
||
|
pragmaDots[i].onclick = function(event) {
|
||
|
// Hide tease
|
||
|
event.target.parentNode.style.display = "none";
|
||
|
// Show actual
|
||
|
event.target.parentNode.nextElementSibling.style.display = "inline";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function switchTheme(e) {
|
||
|
if (e.target.checked) {
|
||
|
document.documentElement.setAttribute('data-theme', 'dark');
|
||
|
localStorage.setItem('theme', 'dark');
|
||
|
} else {
|
||
|
document.documentElement.setAttribute('data-theme', 'light');
|
||
|
localStorage.setItem('theme', 'light');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
|
||
|
if (toggleSwitch !== null) {
|
||
|
toggleSwitch.addEventListener('change', switchTheme, false);
|
||
|
}
|
||
|
|
||
|
var currentTheme = localStorage.getItem('theme');
|
||
|
if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||
|
currentTheme = 'dark';
|
||
|
}
|
||
|
if (currentTheme) {
|
||
|
document.documentElement.setAttribute('data-theme', currentTheme);
|
||
|
|
||
|
if (currentTheme === 'dark' && toggleSwitch !== null) {
|
||
|
toggleSwitch.checked = true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
window.addEventListener('DOMContentLoaded', main);
|
||
|
</script>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="document" id="documentId">
|
||
|
<div class="container">
|
||
|
<h1 class="title">chronos/internal/asyncengine</h1>
|
||
|
<div class="row">
|
||
|
<div class="three columns">
|
||
|
<div class="theme-switch-wrapper">
|
||
|
<label class="theme-switch" for="checkbox">
|
||
|
<input type="checkbox" id="checkbox" />
|
||
|
<div class="slider round"></div>
|
||
|
</label>
|
||
|
<em>Dark Mode</em>
|
||
|
</div>
|
||
|
<div id="global-links">
|
||
|
<ul class="simple">
|
||
|
<li>
|
||
|
<a href="../../theindex.html">Index</a>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="searchInputDiv">
|
||
|
Search: <input type="text" id="searchInput"
|
||
|
onkeyup="search()" />
|
||
|
</div>
|
||
|
<div>
|
||
|
Group by:
|
||
|
<select onchange="groupBy(this.value)">
|
||
|
<option value="section">Section</option>
|
||
|
<option value="type">Type</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<ul class="simple simple-toc" id="toc-list">
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#7" id="57">Types</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
<li><a class="reference" href="#AsyncCallback"
|
||
|
title="AsyncCallback = InternalAsyncCallback">AsyncCallback</a></li>
|
||
|
<li><a class="reference" href="#AsyncFD"
|
||
|
title="AsyncFD = distinct cint">AsyncFD</a></li>
|
||
|
<li><a class="reference" href="#PDispatcher"
|
||
|
title="PDispatcher = ref object of PDispatcherBase">PDispatcher</a></li>
|
||
|
<li><a class="reference" href="#TimerCallback"
|
||
|
title="TimerCallback = ref object
|
||
|
finishAt*: Moment
|
||
|
function*: AsyncCallback">TimerCallback</a></li>
|
||
|
<li><a class="reference" href="#TrackerBase"
|
||
|
title="TrackerBase = ref object of RootRef
|
||
|
id*: string
|
||
|
dump*: proc (): string {.gcsafe, raises: [].}
|
||
|
isLeaked*: proc (): bool {.gcsafe, raises: [].}">TrackerBase</a></li>
|
||
|
<li><a class="reference" href="#TrackerCounter"
|
||
|
title="TrackerCounter = object
|
||
|
opened*: uint64
|
||
|
closed*: uint64">TrackerCounter</a></li>
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#10" id="60">Consts</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
<li><a class="reference" href="#MaxEventsCount"
|
||
|
title="MaxEventsCount = 64">MaxEventsCount</a></li>
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
<ul class="simple nested-toc-section">==
|
||
|
<li><a class="reference" href="#%3D%3D%2CAsyncFD%2CAsyncFD"
|
||
|
title="`==`(x: AsyncFD; y: AsyncFD): bool">`==`(x: AsyncFD; y: AsyncFD): bool</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">addReader2
|
||
|
<li><a class="reference" href="#addReader2%2CAsyncFD%2CCallbackFunc%2Cpointer"
|
||
|
title="addReader2(fd: AsyncFD; cb: CallbackFunc; udata: pointer = nil): Result[void,
|
||
|
OSErrorCode]">addReader2(fd: AsyncFD; cb: CallbackFunc; udata: pointer = nil): Result[void,
|
||
|
OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">addTimer
|
||
|
<li><a class="reference" href="#addTimer%2Cint64%2CCallbackFunc%2Cpointer"
|
||
|
title="addTimer(at: int64; cb: CallbackFunc; udata: pointer = nil)">addTimer(at: int64; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
<li><a class="reference" href="#addTimer%2CMoment%2CCallbackFunc%2Cpointer"
|
||
|
title="addTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil)">addTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
<li><a class="reference" href="#addTimer%2Cuint64%2CCallbackFunc%2Cpointer"
|
||
|
title="addTimer(at: uint64; cb: CallbackFunc; udata: pointer = nil)">addTimer(at: uint64; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">addTracker
|
||
|
<li><a class="reference" href="#addTracker%2Cstring%2CT"
|
||
|
title="addTracker[T](id: string; tracker: T)">addTracker[T](id: string; tracker: T)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">addWriter2
|
||
|
<li><a class="reference" href="#addWriter2%2CAsyncFD%2CCallbackFunc%2Cpointer"
|
||
|
title="addWriter2(fd: AsyncFD; cb: CallbackFunc; udata: pointer = nil): Result[void,
|
||
|
OSErrorCode]">addWriter2(fd: AsyncFD; cb: CallbackFunc; udata: pointer = nil): Result[void,
|
||
|
OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">callIdle
|
||
|
<li><a class="reference" href="#callIdle%2CInternalAsyncCallback"
|
||
|
title="callIdle(acb: AsyncCallback)">callIdle(acb: AsyncCallback)</a></li>
|
||
|
<li><a class="reference" href="#callIdle%2CCallbackFunc"
|
||
|
title="callIdle(cbproc: CallbackFunc)">callIdle(cbproc: CallbackFunc)</a></li>
|
||
|
<li><a class="reference" href="#callIdle%2CCallbackFunc%2Cpointer"
|
||
|
title="callIdle(cbproc: CallbackFunc; data: pointer)">callIdle(cbproc: CallbackFunc; data: pointer)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">callSoon
|
||
|
<li><a class="reference" href="#callSoon%2CInternalAsyncCallback"
|
||
|
title="callSoon(acb: AsyncCallback)">callSoon(acb: AsyncCallback)</a></li>
|
||
|
<li><a class="reference" href="#callSoon%2CCallbackFunc"
|
||
|
title="callSoon(cbproc: CallbackFunc)">callSoon(cbproc: CallbackFunc)</a></li>
|
||
|
<li><a class="reference" href="#callSoon%2CCallbackFunc%2Cpointer"
|
||
|
title="callSoon(cbproc: CallbackFunc; data: pointer)">callSoon(cbproc: CallbackFunc; data: pointer)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">clearTimer
|
||
|
<li><a class="reference" href="#clearTimer%2CTimerCallback"
|
||
|
title="clearTimer(timer: TimerCallback)">clearTimer(timer: TimerCallback)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">closeHandle
|
||
|
<li><a class="reference" href="#closeHandle%2CAsyncFD%2CCallbackFunc"
|
||
|
title="closeHandle(fd: AsyncFD; aftercb: CallbackFunc = nil)">closeHandle(fd: AsyncFD; aftercb: CallbackFunc = nil)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">closeSocket
|
||
|
<li><a class="reference" href="#closeSocket%2CAsyncFD%2CCallbackFunc"
|
||
|
title="closeSocket(fd: AsyncFD; aftercb: CallbackFunc = nil)">closeSocket(fd: AsyncFD; aftercb: CallbackFunc = nil)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">getAsyncTimestamp
|
||
|
<li><a class="reference" href="#getAsyncTimestamp%2CDuration"
|
||
|
title="getAsyncTimestamp(a: Duration): auto">getAsyncTimestamp(a: Duration): auto</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">getGlobalDispatcher
|
||
|
<li><a class="reference" href="#getGlobalDispatcher"
|
||
|
title="getGlobalDispatcher(): PDispatcher">getGlobalDispatcher(): PDispatcher</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">getThreadDispatcher
|
||
|
<li><a class="reference" href="#getThreadDispatcher"
|
||
|
title="getThreadDispatcher(): PDispatcher">getThreadDispatcher(): PDispatcher</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">getTracker
|
||
|
<li><a class="reference" href="#getTracker%2Cstring"
|
||
|
title="getTracker(id: string): TrackerBase">getTracker(id: string): TrackerBase</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">getTrackerCounter
|
||
|
<li><a class="reference" href="#getTrackerCounter%2Cstring"
|
||
|
title="getTrackerCounter(name: string): TrackerCounter">getTrackerCounter(name: string): TrackerCounter</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">internalCallTick
|
||
|
<li><a class="reference" href="#internalCallTick%2CInternalAsyncCallback"
|
||
|
title="internalCallTick(acb: AsyncCallback)">internalCallTick(acb: AsyncCallback)</a></li>
|
||
|
<li><a class="reference" href="#internalCallTick%2CCallbackFunc"
|
||
|
title="internalCallTick(cbproc: CallbackFunc)">internalCallTick(cbproc: CallbackFunc)</a></li>
|
||
|
<li><a class="reference" href="#internalCallTick%2CCallbackFunc%2Cpointer"
|
||
|
title="internalCallTick(cbproc: CallbackFunc; data: pointer)">internalCallTick(cbproc: CallbackFunc; data: pointer)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">isCounterLeaked
|
||
|
<li><a class="reference" href="#isCounterLeaked%2Cstring"
|
||
|
title="isCounterLeaked(name: string): bool">isCounterLeaked(name: string): bool</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">newDispatcher
|
||
|
<li><a class="reference" href="#newDispatcher"
|
||
|
title="newDispatcher(): PDispatcher">newDispatcher(): PDispatcher</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">poll
|
||
|
<li><a class="reference" href="#poll"
|
||
|
title="poll()">poll()</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">raiseAsDefect
|
||
|
<li><a class="reference" href="#raiseAsDefect%2Cref.Exception%2Cstring"
|
||
|
title="raiseAsDefect(exc: ref Exception; msg: string)">raiseAsDefect(exc: ref Exception; msg: string)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">raiseOsDefect
|
||
|
<li><a class="reference" href="#raiseOsDefect%2COSErrorCode%2Cstring"
|
||
|
title="raiseOsDefect(error: OSErrorCode; msg = "")">raiseOsDefect(error: OSErrorCode; msg = "")</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">register2
|
||
|
<li><a class="reference" href="#register2%2CAsyncFD"
|
||
|
title="register2(fd: AsyncFD): Result[void, OSErrorCode]">register2(fd: AsyncFD): Result[void, OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">removeReader2
|
||
|
<li><a class="reference" href="#removeReader2%2CAsyncFD"
|
||
|
title="removeReader2(fd: AsyncFD): Result[void, OSErrorCode]">removeReader2(fd: AsyncFD): Result[void, OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">removeTimer
|
||
|
<li><a class="reference" href="#removeTimer%2Cint64%2CCallbackFunc%2Cpointer"
|
||
|
title="removeTimer(at: int64; cb: CallbackFunc; udata: pointer = nil)">removeTimer(at: int64; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
<li><a class="reference" href="#removeTimer%2CMoment%2CCallbackFunc%2Cpointer"
|
||
|
title="removeTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil)">removeTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
<li><a class="reference" href="#removeTimer%2Cuint64%2CCallbackFunc%2Cpointer"
|
||
|
title="removeTimer(at: uint64; cb: CallbackFunc; udata: pointer = nil)">removeTimer(at: uint64; cb: CallbackFunc; udata: pointer = nil)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">removeWriter2
|
||
|
<li><a class="reference" href="#removeWriter2%2CAsyncFD"
|
||
|
title="removeWriter2(fd: AsyncFD): Result[void, OSErrorCode]">removeWriter2(fd: AsyncFD): Result[void, OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">runForever
|
||
|
<li><a class="reference" href="#runForever"
|
||
|
title="runForever()">runForever()</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">setGlobalDispatcher
|
||
|
<li><a class="reference" href="#setGlobalDispatcher%2CPDispatcher"
|
||
|
title="setGlobalDispatcher(disp: PDispatcher)">setGlobalDispatcher(disp: PDispatcher)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">setThreadDispatcher
|
||
|
<li><a class="reference" href="#setThreadDispatcher%2CPDispatcher"
|
||
|
title="setThreadDispatcher(disp: PDispatcher)">setThreadDispatcher(disp: PDispatcher)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">setTimer
|
||
|
<li><a class="reference" href="#setTimer%2CMoment%2CCallbackFunc%2Cpointer"
|
||
|
title="setTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil): TimerCallback">setTimer(at: Moment; cb: CallbackFunc; udata: pointer = nil): TimerCallback</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">toException
|
||
|
<li><a class="reference" href="#toException%2COSErrorCode"
|
||
|
title="toException(v: OSErrorCode): ref OSError">toException(v: OSErrorCode): ref OSError</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">trackCounter
|
||
|
<li><a class="reference" href="#trackCounter%2Cstring"
|
||
|
title="trackCounter(name: string)">trackCounter(name: string)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">unregister2
|
||
|
<li><a class="reference" href="#unregister2%2CAsyncFD"
|
||
|
title="unregister2(fd: AsyncFD): Result[void, OSErrorCode]">unregister2(fd: AsyncFD): Result[void, OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">unregisterAndCloseFd
|
||
|
<li><a class="reference" href="#unregisterAndCloseFd%2CAsyncFD"
|
||
|
title="unregisterAndCloseFd(fd: AsyncFD): Result[void, OSErrorCode]">unregisterAndCloseFd(fd: AsyncFD): Result[void, OSErrorCode]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">untrackCounter
|
||
|
<li><a class="reference" href="#untrackCounter%2Cstring"
|
||
|
title="untrackCounter(name: string)">untrackCounter(name: string)</a></li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#15" id="65">Iterators</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
<ul class="simple nested-toc-section">trackerCounterKeys
|
||
|
<li><a class="reference" href="#trackerCounterKeys.i%2CPDispatcher"
|
||
|
title="trackerCounterKeys(loop: PDispatcher): string">trackerCounterKeys(loop: PDispatcher): string</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<ul class="simple nested-toc-section">trackerCounters
|
||
|
<li><a class="reference" href="#trackerCounters.i%2CPDispatcher"
|
||
|
title="trackerCounters(loop: PDispatcher): tuple[name: string, value: TrackerCounter]">trackerCounters(loop: PDispatcher): tuple[name: string, value: TrackerCounter]</a></li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<a class="reference reference-toplevel" href="#19" id="69">Exports</a>
|
||
|
<ul class="simple simple-toc-section">
|
||
|
|
||
|
</ul>
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</div>
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
<div class="nine columns" id="content">
|
||
|
<div id="tocRoot"></div>
|
||
|
|
||
|
<p class="module-desc"><p>This module implements the core asynchronous engine / dispatcher.</p>
|
||
|
<p>For more information, see the <tt class="docutils literal"><span class="pre"><span class="Identifier">Concepts</span></span></tt> chapter of the guide.</p>
|
||
|
</p>
|
||
|
<div class="section" id="6">
|
||
|
<h1><a class="toc-backref" href="#6">Imports</a></h1>
|
||
|
<dl class="item">
|
||
|
<a class="reference external" href="../config.html">../config</a>, <a class="reference external" href="../futures.html">../futures</a>, <a class="reference external" href="../osdefs.html">../osdefs</a>, <a class="reference external" href="../oserrno.html">../oserrno</a>, <a class="reference external" href="../osutils.html">../osutils</a>, <a class="reference external" href="../timer.html">../timer</a>, <a class="reference external" href="asyncmacro.html">asyncmacro</a>, <a class="reference external" href="errors.html">errors</a>, <a class="reference external" href="../selectors2.html">../selectors2</a>
|
||
|
</dl></div>
|
||
|
<div class="section" id="7">
|
||
|
<h1><a class="toc-backref" href="#7">Types</a></h1>
|
||
|
<dl class="item">
|
||
|
<div id="AsyncCallback">
|
||
|
<dt><pre><a href="asyncengine.html#AsyncCallback"><span class="Identifier">AsyncCallback</span></a> <span class="Other">=</span> <a href="../futures.html#InternalAsyncCallback"><span class="Identifier">InternalAsyncCallback</span></a></pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L45"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L45" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="AsyncFD">
|
||
|
<dt><pre><a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <span class="Identifier">cint</span></pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L179"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L179" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="PDispatcher">
|
||
|
<dt><pre><a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">PDispatcherBase</span></pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L178"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L178" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="TimerCallback">
|
||
|
<dt><pre><a href="asyncengine.html#TimerCallback"><span class="Identifier">TimerCallback</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
|
||
|
<span class="Identifier">finishAt</span><span class="Operator">*</span><span class="Other">:</span> <a href="../timer.html#Moment"><span class="Identifier">Moment</span></a>
|
||
|
<span class="Identifier">function</span><span class="Operator">*</span><span class="Other">:</span> <a href="asyncengine.html#AsyncCallback"><span class="Identifier">AsyncCallback</span></a>
|
||
|
</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L47"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L47" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="TrackerBase">
|
||
|
<dt><pre><a href="asyncengine.html#TrackerBase"><span class="Identifier">TrackerBase</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">RootRef</span>
|
||
|
<span class="Identifier">id</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
|
||
|
<span class="Identifier">dump</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}
|
||
|
<span class="Identifier">isLeaked</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}
|
||
|
</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L51"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L51" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="TrackerCounter">
|
||
|
<dt><pre><a href="asyncengine.html#TrackerCounter"><span class="Identifier">TrackerCounter</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
|
||
|
<span class="Identifier">opened</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">uint64</span>
|
||
|
<span class="Identifier">closed</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">uint64</span>
|
||
|
</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L56"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L56" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
|
||
|
</dl></div>
|
||
|
<div class="section" id="10">
|
||
|
<h1><a class="toc-backref" href="#10">Consts</a></h1>
|
||
|
<dl class="item">
|
||
|
<div id="MaxEventsCount">
|
||
|
<dt><pre><a href="asyncengine.html#MaxEventsCount"><span class="Identifier">MaxEventsCount</span></a> <span class="Other">=</span> <span class="DecNumber">64</span></pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L31"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L31" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
|
||
|
</dl></div>
|
||
|
<div class="section" id="12">
|
||
|
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||
|
<dl class="item">
|
||
|
<div id="==,AsyncFD,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2CAsyncFD%2CAsyncFD"><span class="Identifier">`==`</span></a><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">y</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">borrow</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L203"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L203" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addReader2,AsyncFD,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addReader2%2CAsyncFD%2CCallbackFunc%2Cpointer"><span class="Identifier">addReader2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span>
|
||
|
<span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L193"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L193" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addTimer,int64,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addTimer%2Cint64%2CCallbackFunc%2Cpointer"><span class="Identifier">addTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <span class="Identifier">int64</span><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use addTimer(Duration, cb, udata)"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use addTimer(Duration, cb, udata)
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1121"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1121" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addTimer,Moment,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addTimer%2CMoment%2CCallbackFunc%2Cpointer"><span class="Identifier">addTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <a href="../timer.html#Moment"><span class="Identifier">Moment</span></a><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use setTimer/clearTimer instead"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use setTimer/clearTimer instead
|
||
|
</div>
|
||
|
|
||
|
Arrange for the callback <tt class="docutils literal"><span class="pre">cb</span></tt> to be called at the given absolute timestamp <tt class="docutils literal"><span class="pre">at</span></tt>. You can also pass <tt class="docutils literal"><span class="pre">udata</span></tt> to callback.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1115"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1115" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addTimer,uint64,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addTimer%2Cuint64%2CCallbackFunc%2Cpointer"><span class="Identifier">addTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <span class="Identifier">uint64</span><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use addTimer(Duration, cb, udata)"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use addTimer(Duration, cb, udata)
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1125"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1125" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addTracker,string,T">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addTracker%2Cstring%2CT"><span class="Identifier">addTracker</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">id</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">tracker</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span> {.
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Please use trackCounter facility instead"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Please use trackCounter facility instead
|
||
|
</div>
|
||
|
|
||
|
Add new <tt class="docutils literal"><span class="pre">tracker</span></tt> object to current thread dispatcher with identifier <tt class="docutils literal"><span class="pre">id</span></tt>.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1212"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1212" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="addWriter2,AsyncFD,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#addWriter2%2CAsyncFD%2CCallbackFunc%2Cpointer"><span class="Identifier">addWriter2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span>
|
||
|
<span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L196"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L196" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callIdle,InternalAsyncCallback">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callIdle%2CInternalAsyncCallback"><span class="Identifier">callIdle</span></a><span class="Other">(</span><span class="Identifier">acb</span><span class="Other">:</span> <a href="asyncengine.html#AsyncCallback"><span class="Identifier">AsyncCallback</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>Schedule <tt class="docutils literal"><span class="pre">cbproc</span></tt> to be called when there no pending network events available.</p>
|
||
|
<p><strong>WARNING!</strong> Despite the name, "idle" callbacks called on every loop iteration if there no network events available, not when the loop is actually "idle".</p>
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1170"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1170" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callIdle,CallbackFunc">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callIdle%2CCallbackFunc"><span class="Identifier">callIdle</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1189"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1189" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callIdle,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callIdle%2CCallbackFunc%2Cpointer"><span class="Identifier">callIdle</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">pointer</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>Schedule <tt class="docutils literal"><span class="pre">cbproc</span></tt> to be called when there no pending network events available.</p>
|
||
|
<p><strong>WARNING!</strong> Despite the name, "idle" callbacks called on every loop iteration if there no network events available, not when the loop is actually "idle".</p>
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1179"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1179" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callSoon,InternalAsyncCallback">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callSoon%2CInternalAsyncCallback"><span class="Identifier">callSoon</span></a><span class="Other">(</span><span class="Identifier">acb</span><span class="Other">:</span> <a href="asyncengine.html#AsyncCallback"><span class="Identifier">AsyncCallback</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Schedule <tt class="docutils literal"><span class="pre"><span class="Identifier">cbproc</span></span></tt> to be called as soon as possible. The callback is called when control returns to the event loop.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1155"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1155" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callSoon,CallbackFunc">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callSoon%2CCallbackFunc"><span class="Identifier">callSoon</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1167"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1167" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="callSoon,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#callSoon%2CCallbackFunc%2Cpointer"><span class="Identifier">callSoon</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">pointer</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Schedule <tt class="docutils literal"><span class="pre"><span class="Identifier">cbproc</span></span></tt> to be called as soon as possible. The callback is called when control returns to the event loop.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1160"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1160" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="clearTimer,TimerCallback">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#clearTimer%2CTimerCallback"><span class="Identifier">clearTimer</span></a><span class="Other">(</span><span class="Identifier">timer</span><span class="Other">:</span> <a href="asyncengine.html#TimerCallback"><span class="Identifier">TimerCallback</span></a><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1112"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1112" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="closeHandle,AsyncFD,CallbackFunc">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#closeHandle%2CAsyncFD%2CCallbackFunc"><span class="Identifier">closeHandle</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">aftercb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L199"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L199" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="closeSocket,AsyncFD,CallbackFunc">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#closeSocket%2CAsyncFD%2CCallbackFunc"><span class="Identifier">closeSocket</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">aftercb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L200"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L200" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="getAsyncTimestamp,Duration">
|
||
|
<dt><pre><span class="Keyword">func</span> <a href="#getAsyncTimestamp%2CDuration"><span class="Identifier">getAsyncTimestamp</span></a><span class="Other">(</span><span class="Identifier">a</span><span class="Other">:</span> <a href="../timer.html#Duration"><span class="Identifier">Duration</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">auto</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>Return rounded up value of duration with milliseconds resolution.</p>
|
||
|
<p>This function also take care on int32 overflow, because Linux and Windows accepts signed 32bit integer as timeout.</p>
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L81"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L81" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="getGlobalDispatcher">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#getGlobalDispatcher"><span class="Identifier">getGlobalDispatcher</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span>
|
||
|
<span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use getThreadDispatcher() instead"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use getThreadDispatcher() instead
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1099"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1099" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="getThreadDispatcher">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#getThreadDispatcher"><span class="Identifier">getThreadDispatcher</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Returns current thread's dispatcher instance.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1089"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1089" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="getTracker,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#getTracker%2Cstring"><span class="Identifier">getTracker</span></a><span class="Other">(</span><span class="Identifier">id</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#TrackerBase"><span class="Identifier">TrackerBase</span></a> {.
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Please use getTrackerCounter() instead"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Please use getTrackerCounter() instead
|
||
|
</div>
|
||
|
|
||
|
Get <tt class="docutils literal"><span class="pre">tracker</span></tt> from current thread dispatcher using identifier <tt class="docutils literal"><span class="pre">id</span></tt>.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1218"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1218" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="getTrackerCounter,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#getTrackerCounter%2Cstring"><span class="Identifier">getTrackerCounter</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#TrackerCounter"><span class="Identifier">TrackerCounter</span></a> {.<span class="Identifier">noinit</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Return value of counter with name <tt class="docutils literal"><span class="pre">name</span></tt>.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1233"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1233" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="internalCallTick,InternalAsyncCallback">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#internalCallTick%2CInternalAsyncCallback"><span class="Identifier">internalCallTick</span></a><span class="Other">(</span><span class="Identifier">acb</span><span class="Other">:</span> <a href="asyncengine.html#AsyncCallback"><span class="Identifier">AsyncCallback</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Schedule <tt class="docutils literal"><span class="pre">cbproc</span></tt> to be called after all scheduled callbacks, but only when OS system queue finished processing events.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1192"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1192" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="internalCallTick,CallbackFunc">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#internalCallTick%2CCallbackFunc"><span class="Identifier">internalCallTick</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1203"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1203" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="internalCallTick,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#internalCallTick%2CCallbackFunc%2Cpointer"><span class="Identifier">internalCallTick</span></a><span class="Other">(</span><span class="Identifier">cbproc</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">data</span><span class="Other">:</span> <span class="Identifier">pointer</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Schedule <tt class="docutils literal"><span class="pre">cbproc</span></tt> to be called after all scheduled callbacks when OS system queue processing is done.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1197"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1197" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="isCounterLeaked,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#isCounterLeaked%2Cstring"><span class="Identifier">isCounterLeaked</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">noinit</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if leak is detected, number of <tt class="docutils literal"><span class="pre"><span class="Identifier">opened</span></span></tt> not equal to number of <tt class="docutils literal"><span class="pre"><span class="Identifier">closed</span></span></tt> requests.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1238"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1238" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="newDispatcher">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#newDispatcher"><span class="Identifier">newDispatcher</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L183"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L183" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="poll">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#poll"><span class="Identifier">poll</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>Perform single asynchronous step, processing timers and completing tasks. Blocks until at least one event has completed.</p>
|
||
|
<p>Exceptions raised during <tt class="docutils literal"><span class="pre"><span class="Identifier">async</span></span></tt> task exection are stored as outcome in the corresponding <tt class="docutils literal"><span class="pre"><span class="Identifier">Future</span></span></tt> - <tt class="docutils literal"><span class="pre"><span class="Identifier">poll</span></span></tt> itself does not raise.</p>
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L184"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L184" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="raiseAsDefect,ref.Exception,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#raiseAsDefect%2Cref.Exception%2Cstring"><span class="Identifier">raiseAsDefect</span></a><span class="Other">(</span><span class="Identifier">exc</span><span class="Other">:</span> <span class="Keyword">ref</span> <span class="Identifier">Exception</span><span class="Other">;</span> <span class="Identifier">msg</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span class="Identifier">noreturn</span><span class="Other">,</span> <span class="Identifier">noinline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L152"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L152" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="raiseOsDefect,OSErrorCode,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#raiseOsDefect%2COSErrorCode%2Cstring"><span class="Identifier">raiseOsDefect</span></a><span class="Other">(</span><span class="Identifier">error</span><span class="Other">:</span> <span class="Identifier">OSErrorCode</span><span class="Other">;</span> <span class="Identifier">msg</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span> {.<span class="Identifier">noreturn</span><span class="Other">,</span> <span class="Identifier">noinline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L159"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L159" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="register2,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#register2%2CAsyncFD"><span class="Identifier">register2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L191"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L191" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="removeReader2,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#removeReader2%2CAsyncFD"><span class="Identifier">removeReader2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L195"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L195" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="removeTimer,int64,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#removeTimer%2Cint64%2CCallbackFunc%2Cpointer"><span class="Identifier">removeTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <span class="Identifier">int64</span><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use removeTimer(Duration, cb, udata)"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use removeTimer(Duration, cb, udata)
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1147"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1147" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="removeTimer,Moment,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#removeTimer%2CMoment%2CCallbackFunc%2Cpointer"><span class="Identifier">removeTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <a href="../timer.html#Moment"><span class="Identifier">Moment</span></a><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Remove timer callback <tt class="docutils literal"><span class="pre">cb</span></tt> with absolute timestamp <tt class="docutils literal"><span class="pre">at</span></tt> from waiting queue.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1129"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1129" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="removeTimer,uint64,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#removeTimer%2Cuint64%2CCallbackFunc%2Cpointer"><span class="Identifier">removeTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <span class="Identifier">uint64</span><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span>
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use removeTimer(Duration, cb, udata)"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use removeTimer(Duration, cb, udata)
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1151"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1151" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="removeWriter2,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#removeWriter2%2CAsyncFD"><span class="Identifier">removeWriter2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L198"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L198" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="runForever">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#runForever"><span class="Identifier">runForever</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Begins a never ending global dispatcher poll loop. Raises different exceptions depending on the platform.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1206"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1206" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="setGlobalDispatcher,PDispatcher">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#setGlobalDispatcher%2CPDispatcher"><span class="Identifier">setGlobalDispatcher</span></a><span class="Other">(</span><span class="Identifier">disp</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span>
|
||
|
<span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">"Use setThreadDispatcher() instead"</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
<div class="deprecation-message">
|
||
|
<b>Deprecated:</b> Use setThreadDispatcher() instead
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1095"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1095" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="setThreadDispatcher,PDispatcher">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#setThreadDispatcher%2CPDispatcher"><span class="Identifier">setThreadDispatcher</span></a><span class="Other">(</span><span class="Identifier">disp</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Set current thread's dispatcher instance to <tt class="docutils literal"><span class="pre">disp</span></tt>.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1083"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1083" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="setTimer,Moment,CallbackFunc,pointer">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#setTimer%2CMoment%2CCallbackFunc%2Cpointer"><span class="Identifier">setTimer</span></a><span class="Other">(</span><span class="Identifier">at</span><span class="Other">:</span> <a href="../timer.html#Moment"><span class="Identifier">Moment</span></a><span class="Other">;</span> <span class="Identifier">cb</span><span class="Other">:</span> <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a><span class="Other">;</span> <span class="Identifier">udata</span><span class="Other">:</span> <span class="Identifier">pointer</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <a href="asyncengine.html#TimerCallback"><span class="Identifier">TimerCallback</span></a> {.
|
||
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Arrange for the callback <tt class="docutils literal"><span class="pre">cb</span></tt> to be called at the given absolute timestamp <tt class="docutils literal"><span class="pre">at</span></tt>. You can also pass <tt class="docutils literal"><span class="pre">udata</span></tt> to callback.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1103"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1103" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="toException,OSErrorCode">
|
||
|
<dt><pre><span class="Keyword">func</span> <a href="#toException%2COSErrorCode"><span class="Identifier">toException</span></a><span class="Other">(</span><span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">OSErrorCode</span><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">ref</span> <span class="Identifier">OSError</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L172"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L172" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="trackCounter,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#trackCounter%2Cstring"><span class="Identifier">trackCounter</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span class="Identifier">noinit</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Increase tracker counter with name <tt class="docutils literal"><span class="pre">name</span></tt> by 1.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1223"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1223" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="unregister2,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#unregister2%2CAsyncFD"><span class="Identifier">unregister2</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L192"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L192" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="unregisterAndCloseFd,AsyncFD">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#unregisterAndCloseFd%2CAsyncFD"><span class="Identifier">unregisterAndCloseFd</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
||
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L201"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L201" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="untrackCounter,string">
|
||
|
<dt><pre><span class="Keyword">proc</span> <a href="#untrackCounter%2Cstring"><span class="Identifier">untrackCounter</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span class="Identifier">noinit</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Decrease tracker counter with name <tt class="docutils literal"><span class="pre">name</span></tt> by 1.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1228"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1228" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
|
||
|
</dl></div>
|
||
|
<div class="section" id="15">
|
||
|
<h1><a class="toc-backref" href="#15">Iterators</a></h1>
|
||
|
<dl class="item">
|
||
|
<div id="trackerCounterKeys.i,PDispatcher">
|
||
|
<dt><pre><span class="Keyword">iterator</span> <a href="#trackerCounterKeys.i%2CPDispatcher"><span class="Identifier">trackerCounterKeys</span></a><span class="Other">(</span><span class="Identifier">loop</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1254"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1254" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
<div id="trackerCounters.i,PDispatcher">
|
||
|
<dt><pre><span class="Keyword">iterator</span> <a href="#trackerCounters.i%2CPDispatcher"><span class="Identifier">trackerCounters</span></a><span class="Other">(</span><span class="Identifier">loop</span><span class="Other">:</span> <a href="asyncengine.html#PDispatcher"><span class="Identifier">PDispatcher</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">,</span>
|
||
|
<span class="Identifier">value</span><span class="Other">:</span> <a href="asyncengine.html#TrackerCounter"><span class="Identifier">TrackerCounter</span></a><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||
|
<dd>
|
||
|
|
||
|
Iterates over <tt class="docutils literal"><span class="pre"><span class="Identifier">loop</span></span></tt> thread dispatcher tracker counter table, returns all the tracker counter's names and values.
|
||
|
<a
|
||
|
href="https://github.com/status-im/nim-chronos/tree/master/chronos/internal/asyncengine.nim#L1245"
|
||
|
class="link-seesrc" target="_blank">Source</a>
|
||
|
<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/internal/asyncengine.nim#L1245" class="link-seesrc" target="_blank" >Edit</a>
|
||
|
|
||
|
</dd>
|
||
|
</div>
|
||
|
|
||
|
</dl></div>
|
||
|
<div class="section" id="19">
|
||
|
<h1><a class="toc-backref" href="#19">Exports</a></h1>
|
||
|
<dl class="item">
|
||
|
<a href="errors.html#AsyncExceptionError"><span class="Identifier">AsyncExceptionError</span></a>, <a href="errors.html#AsyncError"><span class="Identifier">AsyncError</span></a>, <a href="errors.html#AsyncTimeoutError"><span class="Identifier">AsyncTimeoutError</span></a>, <a href="../futures.html#state,FutureBase"><span class="Identifier">state</span></a>, <a href="../futures.html#LocationKind"><span class="Identifier">LocationKind</span></a>, <a href="../futures.html#CallbackFunc"><span class="Identifier">CallbackFunc</span></a>, <a href="../futures.html#error,FutureBase"><span class="Identifier">error</span></a>, <a href="../futures.html#id.t,FutureBase"><span class="Identifier">id</span></a>, <a href="../futures.html#CancelledError"><span class="Identifier">CancelledError</span></a>, <a href="../futures.html#completed.t,typeFuture,static[string]"><span class="Identifier">completed</span></a>, <a href="../futures.html#value,Future[void]"><span class="Identifier">value</span></a>, <a href="../futures.html#FutureFlags"><span class="Identifier">FutureFlags</span></a>, <a href="../futures.html#failed,FutureBase"><span class="Identifier">failed</span></a>, <a href="../futures.html#Future"><span class="Identifier">Future</span></a>, <a href="../futures.html#failed.t,typeFuture[T],ref.CatchableError,static[string]"><span class="Identifier">failed</span></a>, <a href="../srcloc.html#$,ptr.SrcLoc"><span class="Identifier">$</span></a>, <a href="../futures.html#InternalFutureBase"><span class="Identifier">InternalFutureBase</span></a>, <a href="../futures.html#completed,FutureBase"><span class="Identifier">completed</span></a>, <a href="../futures.html#cancelled,FutureBase"><span class="Identifier">cancelled</span></a>, <a href="../futures.html#init.t,typeFuture[T],static[string],static[FutureFlags]"><span class="Identifier">init</span></a>, <a href="../futures.html#InternalAsyncCallback"><span class="Identifier">InternalAsyncCallback</span></a>, <a href="../futures.html#internalInitFutureBase,FutureBase,ptr.SrcLoc,FutureState,FutureFlags"><span class="Identifier">internalInitFutureBase</span></a>, <a href="../futures.html#FutureBase"><span class="Identifier">FutureBase</span></a>, <a href="../futures.html#value,Future[T: not void]"><span class="Identifier">value</span></a>, <a href="../futures.html#finished,FutureBase"><span class="Identifier">finished</span></a>, <a href="../srcloc.html#getSrcLocation.t,staticstring"><span class="Identifier">getSrcLocation</span></a>, <a href="../futures.html#FutureError"><span class="Identifier">FutureError</span></a>, <a href="../futures.html#FutureState"><span class="Identifier">FutureState</span></a>, <a href="../futures.html#init.t,typeFuture[T],static[string]"><span class="Identifier">init</span></a>, <a href="../futures.html#location,FutureBase"><span class="Identifier">location</span></a>, <a href="../futures.html#flags,FutureBase"><span class="Identifier">flags</span></a>, <a href="../futures.html#FutureFlag"><span class="Identifier">FutureFlag</span></a>, <a href="../srcloc.html#SrcLoc"><span class="Identifier">SrcLoc</span></a>, <a href="../futures.html#FutureDefect"><span class="Identifier">FutureDefect</span></a>, <a href="../futures.html#completed.t,typeFuture,T,static[string]"><span class="Identifier">completed</span></a>, <a href="../timer.html#Hour"><span class="Identifier">Hour</span></a>, <a href="../timer.html#init,typedesc[Moment],int64,Duration"><span class="Identifier">init</span></a>, <a href="../timer.html#fromNow,typedesc[Moment],Duration"><span class="Identifier">fromNow</span></a>, <a href="../timer.html#milliseconds,SomeIntegerI64"><span class="Identifier">milliseconds</span></a>, <a href="../timer.html#<,Moment,Moment"><span class="Identifier"><</span></a>, <a href="../timer.html#fastEpochTime"><span class="Identifier">fastEpochTime</span></a>, <a href="../timer.html#Minute"><span class="Identifier">Minute</span></a>, <a href="../timer.html#secs,SomeIntegerI64"><span class="Identifier">secs</span></a>, <a href="../timer.html#Day"><span class="Identifier">Day
|
||
|
</dl></div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="twelve-columns footer">
|
||
|
<span class="nim-sprite"></span>
|
||
|
<br/>
|
||
|
<small style="color: var(--hint);">Made with Nim. Generated: 2024-11-28 08:22:46 UTC</small>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|