Commit graph

153 commits

Author SHA1 Message Date
Gered eed182bdd1 minor cleanups and addition of missing function doc comments 2016-05-29 18:19:17 -04:00
Gered 123b343e81 clean up a bunch of function return values
returning the view-system atom in almost all functions where it makes
sense (at the very least, now chaining calls is much more convenient)
2016-05-29 18:15:53 -04:00
Gered 4a6794ff73 make waiting for threads to exit behaviour the default
switching the optional boolean arg to now be used to decide whether
to skip waiting for the threads or not (default not)
2016-05-29 18:04:40 -04:00
Gered 3e28d19474 make some more internal-use functions private 2016-05-29 18:00:28 -04:00
Gered 3c1b145f2d update unit tests 2016-05-29 17:57:05 -04:00
Gered 280d91b12b go back to non single/global view-system state atom
after thinking about it some more, this way definitely does make
more logical sense to me when it comes to integrating it into a
"Reloaded" type of setup via mount/component. even though i will
almost certainly never use more then 1 simultaneous view-system in any
given project.
2016-05-29 17:56:51 -04:00
Gered f857edd0d6 move statistics out of it's own atom into view-system 2016-05-27 23:17:57 -04:00
Gered 24646b1077 simplify queue-hints! 2016-05-27 23:07:07 -04:00
Gered 343d12849e add some test helper function comments 2016-05-27 15:37:37 -04:00
Gered 6baf8c3c48 add refresh hint tests 2016-05-27 15:29:42 -04:00
Gered 1f92c3fd2e update test memory database in prep. for usage in upcoming tests 2016-05-27 13:21:12 -04:00
Gered e3e29d1d34 refactoring and cleanup 2016-05-27 12:47:22 -04:00
Gered 1c47d4ca67 move actual view refresh processing to new fn to make testing easier 2016-05-27 11:46:46 -04:00
Gered c31a896bd0 refactor 2016-05-26 18:16:17 -04:00
Gered f5e5ec130f add subscription/unsubscription tests 2016-05-26 18:09:43 -04:00
Gered 8b41703f97 remove old unit tests, begin adding new test suite 2016-05-26 13:24:55 -04:00
Gered 41edaf8665 add option to shutdown fns to allow blocking until threads finish 2016-05-26 13:24:23 -04:00
Gered c75cf6abbc fix options comment showing incorrect function argument order 2016-05-25 17:43:40 -04:00
Gered 3a49cf561f clean up error logging 2016-05-25 17:26:40 -04:00
Gered 2fc27341fe add missing cleanup of unneeded view hashes in unsubscribe-all 2016-05-24 10:42:11 -04:00
Gered ff15c42f9a better way of picking which namespace to use in subscribe/unsubscribe
if the view sig specified includes a namespace (even a nil one), then
use it for the subscription. otherwise, call namespace-fn to get one
to use in the subscription.
2016-05-23 12:18:28 -04:00
Gered 8fb1a2cbbb update subscription auth failure handling & non-existing view handling
- if the view specified does not exist, throw an exception instead of
  silently failing
- add "on-unauth-fn" option to view system. call this function if
  subscription authorization fails (some applications may want to audit
  this kind of event)
2016-05-22 22:31:43 -04:00
Gered b9512ff9ba update gitignore 2016-05-22 15:24:59 -04:00
Gered 38f74a880d keep a copy of the options used during init! in view-system 2016-05-22 10:57:53 -04:00
Gered f41b6d5c81 update project.clj 2016-05-21 19:45:39 -04:00
Gered 94e4e6443f update README.md 2016-05-21 19:33:15 -04:00
Gered 93617a4857 update project.clj
i don't need a bunch of this stuff in this fork. no sense keeping it
around (can re-add later if need-be)
2016-05-21 19:27:47 -04:00
Gered 1d42cd4c2e remove environ dependency (not needed anymore) 2016-05-21 19:16:49 -04:00
Gered 943a99717f move refresh queue array object into view-system atom
also means the size is now configured via init! and not an environment
variable
2016-05-21 19:15:17 -04:00
Gered 36f3bdfc64 logging updates 2016-05-21 18:49:33 -04:00
Gered 06f275399a clean up init! and how view-system options are set 2016-05-21 18:19:21 -04:00
Gered 4458ba3ea3 replace add-hint! with queue-hints! 2016-05-21 17:21:03 -04:00
Gered 874cabdb2d add put-hints!
mainly just a convenience function intended for iview implementation
libraries to make use of
2016-05-21 16:29:00 -04:00
Gered 2faf596777 add main init/shutdown to start/stop logging if logger option is given 2016-05-21 15:59:22 -04:00
Gered 323e7497c3 add start/stop functions for the statistics logger 2016-05-21 15:50:39 -04:00
Gered eb55744429 minor cleanup 2016-05-21 14:38:57 -04:00
Gered 2045333ef1 doc comment updates/additions 2016-05-20 19:20:05 -04:00
Gered 172a165549 cleanup old commented out test code 2016-05-20 18:36:19 -04:00
Gered e2dc232392 add "type" to hint maps 2016-05-20 18:13:55 -04:00
Gered eddcfa0929 add namespace-fn for selecting view-sig namespaces on view subs/unsubs 2016-05-20 12:17:09 -04:00
Gered 202ec3995a add auth-fn to allow plugging in pre-subscription authorization checks 2016-05-20 11:39:40 -04:00
Gered 5e253fce31 don't send view-sig namespace out with view data refreshes
i guess for now view namespaces are a server-side only thing?
they were never being sent out before
2016-05-19 22:54:27 -04:00
Gered e4cae8772e wrap calls to view-system send-fn 2016-05-19 22:23:52 -04:00
Gered d64ece2c27 convert to using maps as view-sigs 2016-05-19 22:23:14 -04:00
Gered defd41dd33 add helper init/shutdown functions
this init function only is suitable for non-distributed configurations,
but is probably still worthwhile to have something like this as it
helps remove boilerplate in applications where only a simple config
is needed anyway.

adding shutdown is mostly useful for applications using component/mount
2016-05-19 17:36:21 -04:00
Gered 78feb25839 add helper for setting a put-hints-fn function for IView implementations
another potentially contentious change.

the idea here is based on my inability to come up with a reason why
each library providing an IView implementation (e.g. views-honeysql)
would need a different function for this. in fact, i'd argue that it's
probably a better idea to have all the hints going to a single
"dispatch" function anyway (aka. this put-hints-fn) and have it check
for any metadata on incoming hints and do any custom processing there.
the IView implementation libraries have this ability already to add any
kind of custom metadata to hints anyway.

i don't think anything is lost by this change personally, and it
removes the need to call multiple functions to set a custom put-hints-fn
for each IView library that a project might need.

tl;dr - i like simpler configuration. this change is the beginning
of stuff that helps me do that in the future.
2016-05-19 17:34:25 -04:00
Gered c2ef73e311 also clean up hashes for views with no subscriptions 2016-05-19 10:33:46 -04:00
Gered bbb3a3f189 add convenience function for application config 2016-05-19 10:23:41 -04:00
Gered 6636b1e720 if hints is empty (frequently is), no reason to call refresh-view
also as a nice bonus, this stops the debug log call here from spamming
up the log if the refresh-watcher thread is running on a frequent
timer interval
2016-05-19 10:22:09 -04:00
Gered 4559d39bb7 prevent subscriber and subscribed lists from endlessly filling up
in practice this would probably only be a problem for applications
with lots of views that can be subscribed to that also have very long
uptimes.
2016-05-19 10:20:07 -04:00