Liking cljdoc? Tell your friends :D

fileape.io

Basic api for doing async file IO using refs and agents

Basic api for doing async file IO using refs and agents
raw docstring

agent-root-sendclj

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

async-write!clj

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

async-write-timeout!clj

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

check-roll!clj

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

create-ctxclj

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

create-fileclj

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

create-future-file-nameclj

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

default-confclj

source

do-create-file!clj

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

move-fileclj

(move-file source-file dest-file)
source

nth-oneclj

(nth-one coll)
source

open?clj

(open? ctx)
source

retry-sleep!clj

(retry-sleep! ctx)
source

retry?clj

(retry? ctx tries)
source

shutdown!clj

(shutdown! ctx)
source

update-ctxclj

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

write-to-agent-helperclj

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

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

× close