(active-view-count view-system)
Returns a count of views with at least one subscriber.
Returns a count of views with at least one subscriber.
(add-views! view-system views)
Add a collection of views to the system.
Add a collection of views to the system.
(collecting-stats? view-system)
Whether view statem statistics collection and logging is enabled or not.
Whether view statem statistics collection and logging is enabled or not.
Default options used to initialize the views system via init!
Default options used to initialize the views system via init!
(do-view-refresh! view-system
{:keys [namespace view-id parameters] :as view-sig})
(init! options)
(init! view-system options)
Initializes the view system for use with the list of views provided.
An existing atom that will be used to store the state of the views system can be provided, otherwise one will be created. Either way, the atom with the initialized view system is returned.
options is a map of options to configure the view system with. See views.core/default-options for a description of the available options and the defaults that will be used for any options not provided in the call to init!.
Initializes the view system for use with the list of views provided. An existing atom that will be used to store the state of the views system can be provided, otherwise one will be created. Either way, the atom with the initialized view system is returned. options is a map of options to configure the view system with. See views.core/default-options for a description of the available options and the defaults that will be used for any options not provided in the call to init!.
(put-hints! view-system hints)
Adds a collection of hints to the view system by using the view system configuration's :put-hints-fn.
Adds a collection of hints to the view system by using the view system configuration's :put-hints-fn.
(queue-hints! view-system hints)
Queues up hints in the view system so that they will be picked up by the refresh watcher and dispatched to the workers resulting in view updates being sent out for the relevant views/subscribers.
Queues up hints in the view system so that they will be picked up by the refresh watcher and dispatched to the workers resulting in view updates being sent out for the relevant views/subscribers.
(refresh-view! view-system
hints
{:keys [namespace view-id parameters] :as view-sig})
Schedules a view (identified by view-sig) to be refreshed by one of the worker threads only if the provided collection of hints is relevant to that view.
Schedules a view (identified by view-sig) to be refreshed by one of the worker threads only if the provided collection of hints is relevant to that view.
(refresh-views! view-system)
(refresh-views! view-system hints)
Given a collection of hints, check all views in the system to find any that need refreshing and schedule refreshes for them. If no hints are provided, will use any that have been queued up in the view-system.
Given a collection of hints, check all views in the system to find any that need refreshing and schedule refreshes for them. If no hints are provided, will use any that have been queued up in the view-system.
(reset-stats! view-system)
Resets statistics collected back to zero.
Resets statistics collected back to zero.
(shutdown! view-system & [dont-wait-for-threads?])
Shuts the view system down, terminating all worker threads and clearing all view subscriptions and data.
Shuts the view system down, terminating all worker threads and clearing all view subscriptions and data.
(start-logger! view-system log-interval)
Starts a logger thread that will enable collection of view statistics which the logger will periodically write out to the log.
Starts a logger thread that will enable collection of view statistics which the logger will periodically write out to the log.
(start-update-watcher! view-system min-refresh-interval threads)
Starts threads for the views refresh watcher and worker threads that handle queued hints and view refresh requests.
Starts threads for the views refresh watcher and worker threads that handle queued hints and view refresh requests.
(stop-logger! view-system & [dont-wait-for-thread?])
Stops the logger thread.
Stops the logger thread.
(stop-update-watcher! view-system & [dont-wait-for-threads?])
Stops threads for the views refresh watcher and worker threads.
Stops threads for the views refresh watcher and worker threads.
(subscribe! view-system
{:keys [namespace view-id parameters] :as view-sig}
subscriber-key
context)
Creates a subscription to a view identified by view-sig for a subscriber identified by subscriber-key. If the subscription is not authorized, returns nil. Additional context info can be passed in, which will be passed to the view-system's namespace-fn and auth-fn (if provided). If the subscription is successful, the subscriber will be sent the initial data for the view.
Creates a subscription to a view identified by view-sig for a subscriber identified by subscriber-key. If the subscription is not authorized, returns nil. Additional context info can be passed in, which will be passed to the view-system's namespace-fn and auth-fn (if provided). If the subscription is successful, the subscriber will be sent the initial data for the view.
(subscribed-views view-system)
Returns a list of all views in the system that have subscribers.
Returns a list of all views in the system that have subscribers.
(unsubscribe! view-system
{:keys [namespace view-id parameters] :as view-sig}
subscriber-key
context)
Removes a subscription to a view identified by view-sig for a subscriber identified by subscriber-key. Additional context info can be passed in, which will be passed to the view-system's namespace-fn (if provided).
Removes a subscription to a view identified by view-sig for a subscriber identified by subscriber-key. Additional context info can be passed in, which will be passed to the view-system's namespace-fn (if provided).
(unsubscribe-all! view-system subscriber-key)
Removes all of a subscriber's (identified by subscriber-key) current view subscriptions.
Removes all of a subscriber's (identified by subscriber-key) current view subscriptions.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close