Using notifications vs. listener lists
Using notifications vs. listener lists
- Subject: Using notifications vs. listener lists
- From: Dave Fayram <email@hidden>
- Date: Sat, 4 May 2002 16:11:14 -0700
Hi,
I'm working on a cocoa app that relies heavily on libpcap and I
realized I have a small
design dilemma I don't know the "cocoa" solution for. My little worker
thread is going to be
reading packets of the bpf and it needs to let people know when it
recieves appropriate
packets from various hosts. Sometimes, there could be long periods of
time without any
packets, sometimes there could be hundreds a minute. I'd like to be able
to register multiple,
arbitrary listeners to respond to these events.
My first reaction is to use the NSNotificationCenter and register
listeners (passing the
germane info via the userinfo field) but I don't know if I should use an
NSArray of listeners
and enumerate across that. What is the "Cocoa" way here? I'd like
performance to be decent
as well and I really don't know how well NSNotifications work in terms
of speed.
Could someone fill me in?
- Dave "Paradox" Fayram
My ElGamal and DSA keys can be found at:
http://zero.atomictrain.net:88/~paradox/pgpkey.html
"Not everyone finds Drag'n'Drop as intuitive as they should."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.