Commit graph

21 commits

Author SHA1 Message Date
Peter Taoussanis
ebe8a957f5 [new] Add experimental :thread key to Clj signals
Only downside/hesitation is that this info *must* be collected at the callsite,
which means that it affects the performance of *all* created signals.

Adds ~30-50 nsecs per signal.
2024-05-05 13:58:16 +02:00
Peter Taoussanis
839143167b [mod] Simplify middleware - don't auto compose
Previously:

  It was possible to provide a vector of middleware fns when creating
  signals or adding handlers, e.g.:

    (event! ::ev-id1 {:middleware [fn1 fn2 ...]}),
    (add-handler! ::handler-id1 <handler-fn> {:middleware [fn1 fn2 ...]})

After this commit:

  Middleware is always expected to be a single fn, or nil.
  A `comp-middleware` util has been added to make it easy to compose multiple
  middleware fns into one.

Motivation:

  The previous (auto-composition) behaviour was nice when adding handlers,
  but incurred a (small but non-trivial) runtime cost when creating signals.

  The actual benefit (convenience) of auto-composition is very small, so
  I've decided to just remove this feature and add the `comp-middleware` util.

  Note that I ruled out the option of doing auto-comp only when adding handlers
  since that've meant an inconsistency and so complexity for little benefit.
2024-05-05 13:58:16 +02:00
Peter Taoussanis
63f488082b [nop] Housekeeping 2024-05-05 13:58:16 +02:00
Peter Taoussanis
12f4b35d71 [doc] Documentation improvements 2024-04-29 12:15:19 +02:00
Peter Taoussanis
1d4cdb8a3c [nop] Misc housekeeping 2024-04-29 12:15:19 +02:00
Peter Taoussanis
d04f6d8e5b [nop] Misc housekeeping 2024-04-24 13:22:31 +02:00
Peter Taoussanis
a00291085e [nop] Misc housekeeping 2024-04-18 12:05:32 +02:00
Peter Taoussanis
ee8505933c [doc] Documentation work 2024-04-17 15:51:24 +02:00
Peter Taoussanis
46a468d329 [doc] Expand, polish documentation 2024-04-12 17:50:06 +02:00
Peter Taoussanis
5f98e7304f [mod] Rename signal field: :extra-kvs -> :kvs 2024-04-12 16:54:13 +02:00
Peter Taoussanis
b56f7c4908 [nop] Misc housekeeping 2024-04-12 16:54:13 +02:00
Peter Taoussanis
5c85860b3e [new] Extend trace!, spy! for easier catching 2024-04-05 17:51:14 +02:00
Peter Taoussanis
dae36ef549 [mod] Rework (simplify) with-signal API 2024-04-05 17:51:14 +02:00
Peter Taoussanis
0f0e049993 [mod] Rename signal fields: :instant -> :inst, etc. 2024-03-28 16:24:08 +01:00
Peter Taoussanis
50378146c0 [new] Add explicit :extra-kvs to signals
I.e. groups together all user-level kvs for convenience.
2024-03-28 16:24:08 +01:00
Peter Taoussanis
04725e4a47 [mod] Rename signal field: :schema-version -> :schema 2024-03-28 16:24:08 +01:00
Peter Taoussanis
d13e4da5b9 [mod] Rename signal field: :run-value -> :run-val 2024-03-28 16:24:08 +01:00
Peter Taoussanis
25ed34f022 [mod] Rename signal field: :runtime-nsecs -> :run-nsecs 2024-03-28 16:24:08 +01:00
Peter Taoussanis
d8ef32f088 [nop] Misc housekeeping 2024-03-28 16:24:08 +01:00
Peter Taoussanis
0222bf4ee0 [nop] Misc housekeeping 2024-03-14 10:23:23 +01:00
Peter Taoussanis
5a0d9d8241 [new] Misc API polish, first signal docstrings 2024-03-13 13:01:00 +01:00