vibe.d beta banner
get vibe.d
0.10.1

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

Function createSemaphoreStream

Creates a new semaphore stream instance.

SemaphoreStream!(Stream,Semaphore,LockArgs) createSemaphoreStream(Stream, Semaphore, LockArgs...) (
  Stream stream,
  Semaphore semaphore,
  LockArgs lock_args
)
if (isInputStream!Stream || isOutputStream!Stream);

Parameters

NameDescription
stream The stream to forward any operations to
semaphore Semaphore-like object that offers a lock/unlock or wait/notify interface to limit the amount of concurrent I/O operations. vibe.core.sync provides a suitable semaphore implementation.
lock_args Optional arguments to pass to the semaphore's lock/wait method.

See also

SemaphoreStream

Authors

Sönke Ludwig

Copyright

© 2023 Sönke Ludwig

License

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