dip.publish¶
The dip.publish module implements the infrastructure for publishing
events about a model and for subscribing to those events.
IPublication¶
-
class
dip.publish.IPublication¶ Base class:
InterfaceThe IPublication interface defines the API to be implemented by a model that represents an event related to a published model.
-
event = Str() The event related to the model. The following events are considered to be well known.
- ‘dip.events.opened’
- occurs once just after the model has been opened or created.
- ‘dip.events.closed’
- occurs once just before the model is closed.
- ‘dip.event.active’
- occurs whenever the model becomes active.
- ‘dip.events.inactive’
- occurs whenever the model becomes inactive.
-
model = Any() The model being published.
-
IPublisher¶
-
class
dip.publish.IPublisher¶ Base class:
InterfaceThe IPublisher interface defines the API to be implemented by an object that publishes an event related to a model to other objects that implement the
ISubscriberinterface.-
publication = Instance(IPublication) The publication we have published.
-
ISubscriber¶
-
class
dip.publish.ISubscriber¶ Base class:
InterfaceThe ISubscriber interface defines the API to be implemented by an object that subscribes to the publication of events related to a model by other objects that implement the
IPublisherinterface.-
subscription = Instance(IPublication) The publication we have subscribed to.
-
subscription_type = Instance(type) The type of model that the subscriber is interested in. If it is
Nonethen publications related to all types of model will be subscribed to.
-
Publication¶
-
class
dip.publish.Publication¶ Base class:
ModelThe Publication class is the default implementation of the
IPublicationinterface.