Liking cljdoc? Tell your friends :D

frereth.cp.client.state

Handle the inherently stateful pieces associated with the client side of things.

The fact that this is so big says a lot about needing to re-think my approach

Handle the inherently stateful pieces associated with the client side of things.

The fact that this is so big says a lot about needing to re-think my approach
raw docstring

->message-exchange-modeclj

(->message-exchange-mode {:keys [:frereth.cp.client.state/chan<-server
                                 :frereth.cp.client.state/chan->server
                                 :frereth.cp.message.specs/->child]
                          log-state :frereth.weald.specs/state
                          :as this}
                         initial-server-response)

Just received first real response Message packet from the handshake. Now we can start doing something interesting.

Just received first real response Message packet from the handshake.
Now we can start doing something interesting.
sourceraw docstring

child->clj

(child-> {log-state :frereth.weald.specs/state
          :keys [:frereth.cp.client.state/chan->server
                 :frereth.weald.specs/logger
                 :frereth.cp.client.state/packet-builder
                 :frereth.cp.client.state/server-security]
          :as state}
         timeout
         message-block)

Handle packets streaming out of child

Handle packets streaming out of child
sourceraw docstring

clientextension-initclj

(clientextension-init
  {:keys [:frereth.cp.client.state/client-extension-load-time
          :frereth.weald.specs/logger :frereth.cp.message.specs/recent
          :frereth.cp.shared/extension]
   log-state :frereth.weald.specs/state
   :as this})

Initialize the client-extension

Initialize the client-extension
sourceraw docstring

cpu-utilization-targetclj

source

current-timeoutclj

(current-timeout this)

How long should next step wait before giving up?

How long should next step wait before giving up?
sourceraw docstring

default-timeoutclj

source

do-send-packetclj

(do-send-packet
  {log-state :frereth.weald.specs/state
   {:keys [:frereth.cp.shared.specs/srvr-ip :frereth.cp.shared.specs/srvr-port]
    :as server-security}
     :frereth.cp.client.state/server-security
   :keys [:frereth.cp.client.state/chan->server :frereth.weald.specs/logger]
   :as this}
  on-success
  on-failure
  timeout
  timeout-key
  packet)

Send a ByteBuf (et al) as UDP to the server

With lots of bells, whistles, and callbacks

Send a ByteBuf (et al) as UDP to the server

With lots of bells, whistles, and callbacks
sourceraw docstring

do-stopclj

(do-stop {child-state :frereth.cp.shared.child/state
          log-state :frereth.weald.specs/state
          :as this})
source

extract-child-send-stateclj

(extract-child-send-state state)

Extract the pieces that are actually used to forward a message from the Child

Extract the pieces that are actually used to forward a message from the Child
sourceraw docstring

final-waitclj

(final-wait this sent)

We've received the cookie and responded with a vouch. Now waiting for the server's first real message packet so we can switch into the message exchange loop

We've received the cookie and responded with a vouch.
Now waiting for the server's first real message
packet so we can switch into the message exchange
loop
sourceraw docstring

fork!clj

(fork! {:keys [:frereth.weald.specs/logger :frereth.cp.message.specs/->child
               :frereth.cp.message.specs/child-spawner!
               :frereth.cp.message.specs/message-loop-name]
        log-state :frereth.weald.specs/state
        :as this})

Create a new Child to do all the interesting work.

Create a new Child to do all the interesting work.
sourceraw docstring

initialize-immutable-valuesclj

(initialize-immutable-values
  {:keys [:frereth.cp.message.specs/message-loop-name
          :frereth.cp.client.state/chan<-server
          :frereth.cp.client.state/server-extension
          :frereth.cp.client.state/server-ips :frereth.cp.shared.specs/executor]
   log-state :frereth.weald.specs/state
   :or {executor (exec/utilization-executor cpu-utilization-target)}
   :as this}
  log-initializer)

Sets up the immutable value that will be used in tandem with the mutable state later

Sets up the immutable value that will be used in tandem with the mutable state later
sourceraw docstring

initialize-mutable-state!clj

(initialize-mutable-state! {:keys [:frereth.cp.shared/my-keys
                                   :frereth.cp.client.state/server-security
                                   :frereth.weald.specs/logger
                                   :frereth.cp.message.specs/message-loop-name]
                            :as this}
                           packet-builder)
source

load-keysclj

(load-keys log-state my-keys)
source

put-packetclj

(put-packet chan->server srvr-ip packet srvr-port timeout timeout-key)

Build and put a packet onto channel toward server

No bells, whistles, or anything else to make it fancier than needed

Build and put a packet onto channel toward server

No bells, whistles, or anything else to make it fancier than needed
sourceraw docstring

update-client-short-term-nonceclj

(update-client-short-term-nonce nonce)

Note that this can loop right back to a negative number.

Note that this can loop right back to a negative number.
sourceraw docstring

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

× close