richard@brainstorm.co.uk
)Version: 37003
Date: 2013-08-22 09:44:54 -0600 (Thu, 22 Aug 2013)
Copyright: (C) 1998-2009 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSDistributedNotificationCenter.h
The NSDistributedNotificationCenter
provides a versatile yet simple mechanism for
objects in different processes to communicate
effectively while knowing very little about
each others' internals.
A distributed
notification center acts much like a normal
notification center, but it handles
notifications on a machine-wide (or local
network wide) basis rather than just notifications
within a single process. Objects are able to
register themselves as observers for particular
notification names and objects, and they will
then receive notifications (including optional user
information consisting of a dictionary of
property-list objects) as they are posted.
Since posting of distributed notifications involves
inter-process (and sometimes inter-host)
communication, it is fundamentally slower
than normal notifications, and should be used
relatively sparingly. In order to help with
this, the
NSDistributedNotificationCenter
provides a notion of 'suspension', whereby a
center can be suspended causing notifications for
observers in the process where the center was
suspended to cease receiving notifications.
Observers can specify how notifications are to be
handled in this case (queued or discarded) and
posters can specify that particular notifications
are to be delivered immediately irrespective of
suspension.
Distributed notifications are mediated by a
server process which handles all notifications for a
particular center type. In GNUstep this process
is the gdnc
tool, and when started without
special options, a gdnc process acts as the local
centre for the host it is running on. When started
with the GSNetwork
user default set to
YES
, the gdnc
tool acts as
a local network wide server (you should only run one copy
of gdnc
like this on your LAN).
The
gdnc
process should be started at
machine boot time, but GNUstep will attempt to
start it automatically if it can't find it.
MacOS-X currently defines only a notification
center for the local host. GNUstep also defines a
local network center which can be used from multiple
hosts. By default the system sends this to any gdnc
process it can find which is configured as a
network-wide server, but the
GDNCHost
user default may be used to
specify a particular host to be contacted... this
may be of use where you wish to have logically separate
clusters of machines on a shared LAN.
NSLocalNotificationCenterType
as its
argument.
NSLocalNotificationCenterType
provides
a shared access to a notification center used by
processes on the local host which belong to the
current user. GSPublicNotificationCenterType
provides
a shared access to a notification center used by
processes on the local host belonging to any
user. GSNetworkNotificationCenterType
provides a shared access to a notification center
used by processes on the local network. NSLocalNotificationCenterType
.
NSNotificationSuspensionBehaviorCoalesce
.
NSNotificationSuspensionBehaviorDrop
NSNotificationSuspensionBehaviorCoalesce
NSNotificationSuspensionBehaviorHold
NSNotificationSuspensionBehaviorDeliverImmediately
NO
.
nil
and the
delivery flag set to NO
.
NO
.