2024-03-11 08:49:56 +00:00
|
|
|
Low-level generic signal call.
|
|
|
|
|
|
|
|
|
|
API: [opts] => depends on options [3]
|
|
|
|
|
Default kind: none (optional)
|
|
|
|
|
Default level: none (must be provided)
|
|
|
|
|
|
|
|
|
|
When conditions are met [1], creates a Telemere signal [2] and dispatches it to
|
|
|
|
|
registered handlers for processing (writing to console/disk/db, etc.).
|
|
|
|
|
|
|
|
|
|
If `:run` option is provided: returns value of given run form, or throws.
|
|
|
|
|
Otherwise: returns true iff call conditions were met.
|
|
|
|
|
|
|
|
|
|
Generic signals are fairly low-level and useful mostly for library authors or
|
|
|
|
|
advanced users writing their own wrapper macros. Regular users will typically
|
|
|
|
|
prefer one of the provided wrapper macros optimized for ease-of-use in
|
|
|
|
|
common cases.
|
|
|
|
|
|
|
|
|
|
These all use `signal!` underneath and offer the same options, but vary in
|
|
|
|
|
their defaults and the focus of their call APIs (args and return values):
|
|
|
|
|
|
|
|
|
|
`event!` - (id + opts/level) => true iff signal call was allowed
|
|
|
|
|
`log!` - (message + opts/level) => true iff signal call was allowed
|
|
|
|
|
`error!` - (error + opts/id) => given error (unconditional)
|
|
|
|
|
`trace!` - (form + opts/id) => form's result (value/throw) (unconditional)
|
|
|
|
|
`spy!` - (form + opts/level) => form's result (value/throw) (unconditional)
|
|
|
|
|
|
|
|
|
|
Tips:
|
|
|
|
|
|
2024-03-29 11:30:02 +00:00
|
|
|
- Test using `with-signal`: (with-signal (signal! ...)).
|
2024-03-11 08:49:56 +00:00
|
|
|
- Supports the same options as other signals [3].
|
|
|
|
|
|
|
|
|
|
----------------------------------------
|
2024-04-10 17:31:13 +00:00
|
|
|
[1] See `help:signal-flow` docstring
|
2024-03-11 08:49:56 +00:00
|
|
|
[2] See `help:signal-content` docstring
|
|
|
|
|
[3] See `help:signal-options` docstring
|