Skip to content

Commit

Permalink
Update the documentation for choosing the event loop implementation. F…
Browse files Browse the repository at this point in the history
…ixes #74.
  • Loading branch information
s-ludwig committed Mar 3, 2024
1 parent 4e6315a commit 8b3c72b
Showing 1 changed file with 44 additions and 16 deletions.
60 changes: 44 additions & 16 deletions views/docs.dt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ block vibed.navigation
li: a(href="#dub-publishing") Publishing on the DUB registry
li: a(href="#custom-main") The main function
li: a(href="#privilege-lowering") Privilege lowering
li: a(href="#event-loop-driver") Selecting the event loop driver
li: a(href="#compile-time-configuration") Compile time configuration
li: a(href="#handling-segmentation-faults") Handling segmentation faults on Linux
li.bs-separator: a(href="templates/diet") Diet Reference
Expand Down Expand Up @@ -917,6 +918,49 @@ block vibed.body
}
.caption Example vibe.conf file

section
h3#event-loop-driver Selecting the event loop driver

p By default, the native API for each platform are selected as the default for providing the asynchronous I/O and concurrency primitive support. However, you may select a particular implementation if there are more than one available for the target platform. In order to override the default, add a sub configuration directive to your dub.sdl (choosing the "select" driver in this case):

pre.code.prettyprint.lang-sdl.
dependency "eventcore" version="*"
subConfiguration "eventcore" "select"

p When using a JSON based package recipe, the two lines have to be inserted as follows (the "…" are just placeholders for other possible directives):
pre.code.prettyprint.lang-json.
{
…
"dependencies": {
…
"eventcore": "*"
},
"subConfigurations": {
…
"eventcore": "select"
}
}

p The following implementations are available:

dl
dt: code "epoll"
dd Uses the Linux <code>epoll</code> interface, default when building for Linux, including Android
dt: code "epoll-gaia"
dd Uses the Linux <code>epoll</code> interface and <code>getaddrinfo_a</code> for asynchronous DNS lookups
dt: code "cfrunloop"
dd On Darwin based systems (macOS/iOS), uses <code>CFRunLoop</code> in order to be compatible with GUI applications, default on macOS and iOS
dt: code "kqueue"
dd Uses the BSD <code>kqueue</code> interface, default on FreeBSD, also available on Darwin based systems
dt: code "winapi"
dd Windows API based implementation using <code>MsgWaitForMultipleObjectsEx</code> in order to be compatible with GUI applications, default on Windows
dt: code "select"
dd Available for all Posix compliant systems, as well as Windows, uses <code>select()</code> for non-blocking I/O, only recommended for otherwise unsupported platforms
dt: code "libasync"
dd Uses the libasync library to choose and wrap the operating system specific API
dt: code "generic"
dd Does not provide a driver, but instead requires calling <code>setupEventDriver</code> to set a custom driver implementation

section
h3#compile-time-configuration Compile time configuration

Expand Down Expand Up @@ -994,22 +1038,6 @@ block vibed.body
td: code: del VibeUseOldOpenSSL
td #[del Disables the use of features introduced in OpenSSL 1.0.1 or later, most notably ECDH curve selection. Use this to link against old versions of the OpenSSL library.] Deprecated for 0.8.0 and up, see the #[a(href="#http-https") HTTPS section] instead

tr
td: code: del VibeLibevDriver
td #[del Enables the libev based event driver (not fully functional).] This driver has been removed.

tr
td: code: del VibeLibeventDriver
td #[del Enables the libevent based event driver (currently the default).] Do not use this version directly, but select the "libevent" configuration in your dub.json instead.

tr
td: code: del VibeWin32Driver
td #[del Enables the Win32 based event driver (provides GUI message support on Windows).] Do not use this version directly, but select the "win32" configuration in your dub.json instead.

tr
td: code: del VibeWinrtDriver
td #[del Enables the WinRT based event driver (not yet implemented).] This driver has been removed


section
h3#handling-segmentation-faults Handling segmentation-faults on Linux
Expand Down

0 comments on commit 8b3c72b

Please sign in to comment.