Basic api for doing async file IO using refs and agents
Basic api for doing async file IO using refs and agents
(agent-root-send k ctx file-key writer-f tries m)
Called from the root agent Will retry on exception as long as retry? return true otherwise on exception it will call (>!! error-ch [exception writer-f])
Called from the root agent Will retry on exception as long as retry? return true otherwise on exception it will call (>!! error-ch [exception writer-f])
(async-write! k ctx file-key writer-f)
Creates a file based on the key k, the file descriptor is cached so that its only created once The descriptor is passed to the writer-f, and the final state is maintained in the (:state ctx)
Creates a file based on the key k, the file descriptor is cached so that its only created once The descriptor is passed to the writer-f, and the final state is maintained in the (:state ctx)
(async-write-timeout! k ctx file-key writer-f timeout)
Creates a file based on the key k, the file descriptor is cached so that its only created once The descriptor is passed to the writer-f, and the final state is maintained in the (:state ctx)
Creates a file based on the key k, the file descriptor is cached so that its only created once The descriptor is passed to the writer-f, and the final state is maintained in the (:state ctx)
(check-roll! ctx check-f & {:keys [close-and-wait] :or {close-and-wait false}})
helper function that calls reducer-roll-if in a transaction and alters the ref (:state ctx)
helper function that calls reducer-roll-if in a transaction and alters the ref (:state ctx)
(create-ctx conf env roll-ch)
(create-ctx conf env roll-ch error-ch)
error-ch is called with [error function-sent-to-agent]
error-ch is called with [error function-sent-to-agent]
(create-file base-dir codec file-key)
Create and return a File object with the name based on the file key codec and base dir
Create and return a File object with the name based on the file key codec and base dir
(create-future-file-name f)
Create the filename that would be written once the file has been rolled
Create the filename that would be written once the file has been rolled
(do-create-file! base-dir codec file-key)
Create the parent directories and run create new file
Create the parent directories and run create new file
(update-ctx {:keys [root-agent roll-ch env shutdown-flag error-ch]} conf)
Returns a new CTX with a new config applied, all other values are kept as is
Returns a new CTX with a new config applied, all other values are kept as is
(write-to-agent-helper k ctx file-key writer-f m)
Helper function from agent-root-send-f that does: create-if-not agent write to agent, return result of nth-one
Helper function from agent-root-send-f that does: create-if-not agent write to agent, return result of nth-one
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close