client.clj

Branches > main > a212003 > files / src / net / bowmap / network / client.clj

(ns net.bowmap.network.client
  (:require
   [clojure.core.async :refer [chan]]
   [clojure.spec.alpha :as s]
   [net.bowmap.transport.connection :as connection]
   [net.bowmap.network.state :as state]))

(s/def ::client (s/keys :opt [::state/connection-state ::connection/connection]))

(defn client [connection]
  {::state/connection-state ::state/handshaking
   ::connection/connection connection
   ; Not the best place but I can move later
   ::clientbound-packets (chan 1024)})