Tor.framework icon indicating copy to clipboard operation
Tor.framework copied to clipboard

TORController's observer events should be more concrete, and also renamed to handlers

Open mxms0 opened this issue 8 years ago • 0 comments

TORController currently has -addObserverForStatusEvents:, which passes a block with strings and dictionaries with unknown keys.

Type, severity, action, can all be made into enums. I'm not sure what currently is in args, but perhaps making that into an object too, that way it's clear what values are expected to be in it (optional).

Secondly, and feel free to correct me, they should probably be handlers, not observers, even though this is a pedantic thing. They return a bool indicating whether or not they are the designated handler (or are choosing to act as one) for the specified data.

mxms0 avatar Jan 12 '17 18:01 mxms0