Table of Contents

Class: Semaphore ./src/peak/events/sources.py

Allow up to n tasks to proceed simultaneously

A Semaphore is like a Condition, except that it does not broadcast its events. Each event is supplied to callbacks only until one "accepts" the event (by returning a true value).

Semaphore instances also have put() and take() methods that respectively increase or decrease their value by 1.

Note that Semaphore does not automatically decrease its count due to a callback or task resumption. You must explicitly take() the semaphore in your task or callback to reduce its count.

Base Classes   
Condition
Methods   
put
take
  put 
put ( self )

See events.ICondition.put()

  take 
take ( self )

See events.ICondition.take()


Table of Contents

This document was automatically generated on Mon Mar 25 01:11:05 2024 by HappyDoc version 2.1