Liking cljdoc? Tell your friends :D

views.core


->view-sigclj

(->view-sig view-id parameters)
(->view-sig namespace view-id parameters)
source

active-view-countclj

(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.
sourceraw docstring

add-views!clj

(add-views! view-system views)

Add a collection of views to the system.

Add a collection of views to the system.
sourceraw docstring

collecting-stats?clj

(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.
sourceraw docstring

default-optionsclj

Default options used to initialize the views system via init!

Default options used to initialize the views system via init!
sourceraw docstring

do-view-refresh!clj

(do-view-refresh! view-system
                  {:keys [namespace view-id parameters] :as view-sig})
source

hintclj

(hint namespace hint type)

Create a hint.

Create a hint.
sourceraw docstring

init!clj

(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!.
sourceraw docstring

put-hints!clj

(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.
sourceraw docstring

queue-hints!clj

(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.
sourceraw docstring

refresh-view!clj

(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.
sourceraw docstring

refresh-views!clj

(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.
sourceraw docstring

reset-stats!clj

(reset-stats! view-system)

Resets statistics collected back to zero.

Resets statistics collected back to zero.
sourceraw docstring

shutdown!clj

(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.
sourceraw docstring

start-logger!clj

(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.
sourceraw docstring

start-update-watcher!clj

(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.
sourceraw docstring

stop-logger!clj

(stop-logger! view-system & [dont-wait-for-thread?])

Stops the logger thread.

Stops the logger thread.
sourceraw docstring

stop-update-watcher!clj

(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.
sourceraw docstring

subscribe!clj

(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.
sourceraw docstring

subscribed-viewsclj

(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.
sourceraw docstring

unsubscribe!clj

(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).
sourceraw docstring

unsubscribe-all!clj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close