vibe.d beta banner
get vibe.d
0.9.5

Asynchronous I/O that doesn’t get in your way, written in D

Function runWorkerTask

Runs a new asynchronous task in a worker thread.

void runWorkerTask(FT, ARGS...) (
  FT func,
  auto ref ARGS args
)
if (isFunctionPointer!FT && isNothrowCallable!(FT, ARGS));

void runWorkerTask(alias method, T, ARGS...) (
  shared(T) object,
  auto ref ARGS args
)
if (isNothrowMethod!(shared(T), method, ARGS));

void runWorkerTask(FT, ARGS...) (
  TaskSettings settings,
  FT func,
  auto ref ARGS args
)
if (isFunctionPointer!FT && isNothrowCallable!(FT, ARGS));

void runWorkerTask(alias method, T, ARGS...) (
  TaskSettings settings,
  shared(T) object,
  auto ref ARGS args
)
if (isNothrowMethod!(shared(T), method, ARGS));

void runWorkerTask(FT, ARGS...) (
  FT func,
  auto ref ARGS args
)
if (isFunctionPointer!FT && isCallable!(FT, ARGS) && !isNothrowCallable!(FT, ARGS));

void runWorkerTask(alias method, T, ARGS...) (
  shared(T) object,
  auto ref ARGS args
)
if (isMethod!(shared(T), method, ARGS) && !isNothrowMethod!(shared(T), method, ARGS));

void runWorkerTask(FT, ARGS...) (
  TaskSettings settings,
  FT func,
  auto ref ARGS args
)
if (isFunctionPointer!FT && isCallable!(FT, ARGS) && !isNothrowCallable!(FT, ARGS));

void runWorkerTask(alias method, T, ARGS...) (
  TaskSettings settings,
  shared(T) object,
  auto ref ARGS args
)
if (isMethod!(shared(T), method, ARGS) && !isNothrowMethod!(shared(T), method, ARGS));

Only function pointers with weakly isolated arguments are allowed to be able to guarantee thread-safety.

Authors

Sönke Ludwig

Copyright

© 2012-2020 Sönke Ludwig

License

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