Platforms to show: All Mac Windows Linux Cross-Platform

NSDistributedNotificationCenterMBS class

Super class: NSNotificationCenterMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Notifications MBS MacBase Plugin 9.7 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The NSDistributedNotificationCenter class provides a way to send notifications to objects in other tasks.

It takes NSNotification objects and broadcasts them to any objects in other tasks that have registered for the notification with their task's default distributed notification center.

The NSDistributedNotificationCenter class implements a notification center that can distribute notifications asynchronously to tasks other than the one in which the notification was posted. An instance of this class are known as a distributed notification center.

Each task has a default distributed notification center that you access with the defaultCenter class method. There may be different types of distributed notification centers. Currently there is a single type—NSLocalNotificationCenterType. This type of distributed notification center handles notifications that can be sent between tasks on a single computer. For communication between tasks on different computers, use Distributed Objects Programming Topics.

Posting a distributed notification is an expensive operation. The notification gets sent to a system-wide server that distributes it to all the tasks that have objects registered for distributed notifications. The latency between posting the notification and the notification's arrival in another task is unbounded. In fact, when too many notifications are posted and the server's queue fills up, notifications may be dropped.
Subclass of the NSNotificationCenterMBS class.

Constants

Constant Value Description
NSNotificationDeliverImmediately 1 One of the option constants to specify the behavior of notifications posted using the postNotificationName method. When set, the notification is delivered immediately to all observers, regardless of their suspension behavior or suspension state. When not set, allows the normal suspension behavior of notification observers to take place.
NSNotificationPostToAllSessions 2 One of the option constants to specify the behavior of notifications posted using the postNotificationName method. When set, the notification is posted to all sessions. When not set, the notification is sent only to applications within the same login session as the posting task.
NSNotificationSuspensionBehaviorCoalesce 2 One of the constants to specify the types of notification delivery suspension behaviors. The server only queues the last notification of the specified name and object; earlier notifications are dropped. In cover methods for which suspension behavior is not an explicit argument, NSNotificationSuspensionBehaviorCoalesce is the default.
NSNotificationSuspensionBehaviorDeliverImmediately 4 One of the constants to specify the types of notification delivery suspension behaviors. The server delivers notifications matching this registration irrespective of whether Suspended is set to true. When a notification with this suspension behavior is matched, it has the effect of first flushing any queued notifications. The effect is as if setSuspended: with an argument of false were first called if the application is suspended, followed by the notification in question being delivered, followed by a transition back to the previous suspended or unsuspended state.
NSNotificationSuspensionBehaviorDrop 1 One of the constants to specify the types of notification delivery suspension behaviors. The server does not queue any notifications with this name and object until Suspended is set to false.
NSNotificationSuspensionBehaviorHold 3 One of the constants to specify the types of notification delivery suspension behaviors. The server holds all matching notifications until the queue has been filled (queue size determined by the server), at which point the server may flush queued notifications.

Super class NSNotificationCenterMBS

This class has no sub classes.

Some examples using this class:

Blog Entries


The items on this page are in the following plugins: MBS MacBase Plugin.


NSDirectoryEnumeratorMBS   -   NSDockTileMBS


The biggest plugin in space...