Table of Contents

Module: sources ./src/peak/events/sources.py
Imported modules   
from interfaces import *
from peak.core import protocols, adapt, NOT_GIVEN
from types import MethodType
from weakref import ref
Functions   
noNew
subscribe
  noNew 
noNew ( *args )

Exceptions   
TypeError( "Only one Null instance allowed" )
  subscribe 
subscribe ( source,  callback )

Subscribe callback to an IEventSource, using a weak reference

Usage:: canceller = events.subscribe(source,callback)

This function returns a callable that can be used to cancel the subscription: just invoke canceller() and no subsequent callbacks will be received. The callback will be wrapped in a weak reference, so if the callback goes away, the subscription automatically halts. (Note that if callback is a method, then the subscription ends when the object that owns the method goes away.

Classes   

AbstractConditional

Base class for an 'IConditional': fires if and only if value is true

AnyOf

Union of multiple event sources

Broadcaster

Like a distributor, but broadcasting events to all callbacks

Condition

Send callbacks/allow tasks to proceed when condition is true

DerivedCondition

DerivedCondition(formula, *values)' - derive condition from value(s)

DerivedValue

DerivedValue(formula, *values)' - a value derived from other values

Distributor

Sends each event to one callback

Intersect

Not

NullClass

Null condition: never fires, never has a value other than None

Observable

Base class for a generic event source

Readable

Base class for an IReadableSource
adds a _value and '__call__

ReadableAsCondition

Wrap an IReadableSource as an 'IConditional

Semaphore

Allow up to n tasks to proceed simultaneously

Union

Value

Broadcast changes in a variable to all observers

Writable

Base class for an IWritableSource
adds a set() method

WritableAsCondition

Wrap an IWritableValue as an 'IConditional

_compound


Table of Contents

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