Skip to content

Commit

Permalink
doc: fix parse-long references across the tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
olepbr committed Apr 23, 2023
1 parent 7b31757 commit 3c72775
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial/03-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ We can use that to determine the `:type` of the CaS operation.
```clj
(invoke! [_ test op]
(case (:f op)
:read (assoc op :type :ok, :value (parse-long (v/get conn "foo")))
:read (assoc op :type :ok, :value (parse-long-nil (v/get conn "foo")))
:write (do (v/reset! conn "foo" (:value op))
(assoc op :type :ok))
:cas (let [[old new] (:value op)]
Expand Down Expand Up @@ -375,7 +375,7 @@ error code.
```clj
(invoke! [this test op]
(case (:f op)
:read (assoc op :type :ok, :value (parse-long (v/get conn "foo")))
:read (assoc op :type :ok, :value (parse-long-nil (v/get conn "foo")))
:write (do (v/reset! conn "foo" (:value op))
(assoc op :type :ok))
:cas (try+
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/05-nemesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ that:
(case (:f op)
:read (let [value (-> conn
(v/get "foo" {:quorum? true})
parse-long)]
parse-long-nil)]
(assoc op :type :ok, :value value))
...
```
Expand Down
6 changes: 3 additions & 3 deletions doc/tutorial/06-refining.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ safely convert crashed reads to failed reads, and improve checker performance.
(case (:f op)
:read (try (let [value (-> conn
(v/get "foo" {:quorum? true})
parse-long)]
parse-long-nil)]
(assoc op :type :ok, :value value))
(catch java.net.SocketTimeoutException ex
(assoc op :type :fail, :error :timeout)))
Expand All @@ -70,7 +70,7 @@ a little cleaner.
(case (:f op)
:read (let [value (-> conn
(v/get "foo" {:quorum? true})
parse-long)]
parse-long-nil)]
(assoc op :type :ok, :value value))
:write (do (v/reset! conn "foo" (:value op))
(assoc op :type :ok))
Expand Down Expand Up @@ -163,7 +163,7 @@ keys.
(case (:f op)
:read (let [value (-> conn
(v/get k {:quorum? true})
parse-long)]
parse-long-nil)]
(assoc op :type :ok, :value (independent/tuple k value)))

:write (do (v/reset! conn k v)
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/07-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ reads, in the Client `invoke` function:
(case (:f op)
:read (let [value (-> conn
(v/get k {:quorum? (:quorum test)})
parse-long)]
parse-long-nil)]
(assoc op :type :ok, :value (independent/tuple k value)))
```

Expand Down

0 comments on commit 3c72775

Please sign in to comment.