vibe.core.core

This module contains the core functionality of the vibe.d framework.

See runApplication for the main entry point for typical vibe.d server or GUI applications.

Public Imports

vibe.core.driver
public import vibe.core.driver;
Undocumented in source.

Members

Aliases

TaskArgsVariant
alias TaskArgsVariant = VariantN!maxTaskParameterSize
Undocumented in source.
TaskEventCb
alias TaskEventCb = void function(TaskEvent, Task) nothrow
Undocumented in source.

Enums

TaskEvent
enum TaskEvent

High level state change events for a Task

Functions

createFileDescriptorEvent
FileDescriptorEvent createFileDescriptorEvent(int file_descriptor, FileDescriptorEvent.Trigger event_mask, FileDescriptorEvent.Mode event_mode)

Creates an event to wait on an existing file descriptor.

createTimer
Timer createTimer(void delegate() @(safe) callback)
Timer createTimer(void delegate() @(system) callback)

Creates a new timer without arming it.

disableDefaultSignalHandlers
void disableDefaultSignalHandlers()

Disables the signal handlers usually set up by vibe.d.

exitEventLoop
void exitEventLoop(bool shutdown_all_threads)

Stops the currently running event loop.

getgrgid
group* getgrgid(gid_t )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
getgrnam
group* getgrnam(char* )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
lowerPrivileges
void lowerPrivileges(string uname, string gname)

Sets the effective user and group ID to the ones configured for privilege lowering.

lowerPrivileges
void lowerPrivileges()
Undocumented in source. Be warned that the author may not have intended to support it.
processEvents
bool processEvents()

Process all pending events without blocking.

rawYield
void rawYield()

Yields execution of this task until an event wakes it up again.

runApplication
int runApplication(void delegate(string[]) args_out)

Performs final initialization and runs the event loop.

runEventLoop
int runEventLoop()

Starts the vibe.d event loop for the calling thread.

runTask
Task runTask(void delegate(ARGS) @(safe) task, ARGS args)
Task runTask(void delegate(ARGS) task, ARGS args)

Runs a new asynchronous task.

runWorkerTask
void runWorkerTask(FT func, ARGS args)
void runWorkerTask(shared(T) object, ARGS args)

Runs a new asynchronous task in a worker thread.

runWorkerTaskDist
void runWorkerTaskDist(FT func, ARGS args)
void runWorkerTaskDist(shared(T) object, ARGS args)

Runs a new asynchronous task in all worker threads concurrently.

runWorkerTaskH
Task runWorkerTaskH(FT func, ARGS args)
Task runWorkerTaskH(shared(T) object, ARGS args)

Runs a new asynchronous task in a worker thread, returning the task handle.

setIdleHandler
void setIdleHandler(void delegate() @(safe) del)
void setIdleHandler(bool delegate() @(safe) del)

Sets a callback that is called whenever no events are left in the event queue.

setIdleHandler
void setIdleHandler(void delegate() @(system) del)
void setIdleHandler(bool delegate() @(system) del)

Scheduled for deprecation - use a @safe callback instead.

setTaskEventCallback
void setTaskEventCallback(TaskEventCb func)

Sets a callback that is invoked whenever a task changes its status.

setTaskStackSize
void setTaskStackSize(size_t sz)

Sets the stack size to use for tasks.

setTimer
Timer setTimer(Duration timeout, void delegate() @(safe) callback, bool periodic)
Timer setTimer(Duration timeout, void delegate() @(system) callback, bool periodic)

Returns a new armed timer.

setupDriver
void setupDriver()
Undocumented in source. Be warned that the author may not have intended to support it.
setupWorkerThreads
void setupWorkerThreads(uint num)

Sets up the thread pool used for executing worker tasks.

sleep
void sleep(Duration timeout)

Suspends the execution of the calling task for the specified amount of time.

yield
void yield()

Suspends the execution of the calling task to let other tasks and events be handled.

Manifest constants

maxTaskParameterSize
enum maxTaskParameterSize;

The maximum combined size of all parameters passed to a task delegate

vibeVersionString
enum vibeVersionString;

A version string representing the current vibe.d version

Properties

logicalProcessorCount
uint logicalProcessorCount [@property getter]

Determines the number of logical processors in the system.

workerThreadCount
size_t workerThreadCount [@property getter]

The number of worker threads used for processing worker tasks.

Structs

TaskLocal
struct TaskLocal(T)

Implements a task local storage variable.

Timer
struct Timer

Represents a timer.

group
struct group
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig