[Bro-Dev] changing Notice::policy mechanism
Siwek, Jonathan Luke
jsiwek at illinois.edu
Thu Nov 8 08:36:18 PST 2012
More variants…
It could be like synchronous signal handling with "raise" and "trap" keywords.
trap trigger(n: Notice::Info) &priority=5
{
if ( xxx )
break; # short circuit
}
trap trigger(n: Notice::Info) &priority=-5
{
if ( yyy )
do_someting();
}
[...]
local n: Notice::Info;
raise trigger(n);
[…]
It could be like exception handling with "throw", and "catch" keywords.
catch trigger(n: Notice::Info) &priority=5
{
if ( xxx )
throw; # rethrow to continue handling
}
catch trigger(n: Notice::Info) &priority=-5
{
if ( yyy )
do_someting();
# handling stops here because it's not rethrown
}
[...]
local n: Notice::Info;
throw trigger(n);
[…]
Jon
More information about the bro-dev
mailing list