Skip to content

Commit 39591a6

Browse files
committed
several improvements
- fix tests - make code more consistent - add owner concept
2 parents 282b579 + d8056f7 commit 39591a6

34 files changed

Lines changed: 422 additions & 268 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pom.xml.asc
1313
.hg/
1414
.clj-kondo
1515
test/*.db
16+
.lsp/
1617

1718
.cpcache
1819
.shadow-cljs

DEVELOPMENT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,17 @@ Install earthly: https://earthly.dev
5050
```
5151
earthly -P -i +test
5252
```
53+
54+
# Check FDB is working for your architecture
55+
56+
```shell
57+
58+
$ JAVA_OPTS="-DFDB_LIBRARY_PATH_FDB_C=/usr/local/lib/libfdb_c.dylib -DFDB_LIBRARY_PATH_FDB_JAVA=/usr/local/lib/libfdb_java.jnilib" clj -A:fdb:jdbc
59+
60+
(import 'com.apple.foundationdb.JNIUtil)
61+
(let [method (.getDeclaredMethod com.apple.foundationdb.JNIUtil "loadLibrary" (into-array Class [String]))]
62+
(.setAccessible method true)
63+
(.invoke method com.apple.foundationdb.JNIUtil (object-array ["fdb_java"]))
64+
(.invoke method com.apple.foundationdb.JNIUtil (object-array ["fdb_c"])))
65+
66+
```

Earthfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ deps:
2525
CACHE ~/.m2
2626
RUN clj -Stree
2727
RUN npm install
28+
#RUN wget https://github.com/apple/foundationdb/releases/download/7.3.63/foundationdb-clients_7.3.63-1_aarch64.deb
29+
#RUN dpkg -i foundationdb-clients_7.3.63-1_aarch64.deb
2830
RUN wget https://github.com/apple/foundationdb/releases/download/7.1.31/foundationdb-clients_7.1.31-1_amd64.deb
2931
RUN dpkg -i foundationdb-clients_7.1.31-1_amd64.deb
3032
RUN echo "docker:docker@127.0.0.1:4500" > /etc/foundationdb/fdb.cluster

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Examples:
5656
(foo pr :X))))
5757

5858
(def mstore (store/make-memstore))
59-
(def worker (w/start-worker! mstore {`MyActivities (->MyActivitiesImpl)}))
59+
(def stop-worker (w/start-worker! mstore {`MyActivities (->MyActivitiesImpl)}))
6060

6161
;; note that in cljs, this returns a promise
6262
(def res (w/with-env {:store mstore}

bin/kaocha

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[ -d "node_modules/ws" ] || npm install ws
44

5-
#JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dio.netty.tryUnsafe=false"
6-
JAVA_OPTS="-Dio.netty.tryUnsafe=false"
5+
JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dio.netty.tryUnsafe=false"
6+
JAVA_OPTS="$JAVA_OPTS -Dio.netty.tryUnsafe=false"
77
if [[ "$OSTYPE" == "darwin"* ]]; then
88
JAVA_OPTS="-Dio.netty.tryUnsafe=false -DFDB_LIBRARY_PATH_FDB_C=/usr/local/lib/libfdb_c.dylib -DFDB_LIBRARY_PATH_FDB_JAVA=/usr/local/lib/libfdb_java.jnilib"
99
fi

bin/run-coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ lcov --add-tracefile target/coverage-clj/lcov.info --add-tracefile target/cover
2020
genhtml coverage/lcov.merged.info -o coverage
2121

2222
printf "${BLUE}done! opening report${NC}\n"
23-
xdg-open coverage/index.html || true
23+
xdg-open coverage/index.html || open coverage/index.html || true

dev/intemporal/demo_parallelism.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@(p/all proms)))
2828

2929
(def mstore (store/make-store))
30-
(def worker (w/start-worker! mstore {:protocols {`ThreadActivity (->ThreadActivityImpl)}}))
30+
(def stop-worker (w/start-worker! mstore {:protocols {`ThreadActivity (->ThreadActivityImpl)}}))
3131

3232
;; note that in cljs, this returns a promise
3333
(def res (w/with-env {:store mstore}

dev/intemporal/demo_recovery.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
;; make a backup of the db to allow replay
2222
(io/copy (io/file "./dev/intemporal/recovery.edn") (io/file "/tmp/intemporal-recovery.edn"))
2323
(def mstore (store/make-store {:file "/tmp/intemporal-recovery.edn"}))
24-
(def worker (w/start-worker! mstore))
24+
(def stop-worker (w/start-worker! mstore))
2525

2626
(defn pprint-table [table]
2727
(clojure.pprint/print-table table))

dev/intemporal/demo_saga.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171

7272
(def mstore (s/make-store))
73-
(def worker (w/start-worker! mstore {:protocols {`TripBookingActivities example-impl}}))
73+
(def stop-worker (w/start-worker! mstore {:protocols {`TripBookingActivities example-impl}}))
7474

7575
;; note that in cljs, this returns a promise
7676
(def res (try

dev/intemporal/demo_vthread_recovery.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
;; make a backup of the db to allow replay
3131
(io/copy (io/file "./dev/intemporal/vthread-recovery.edn") (io/file "/tmp/intemporal-vthread-recovery.edn"))
3232
(def mstore (store/make-store {:file "/tmp/intemporal-vthread-recovery.edn"}))
33-
(def worker (w/start-worker! mstore {:protocols {`intemporal.demo-vthread-recovery/ThreadActivity (->ThreadActivityImpl)}}))
33+
(def stop-worker (w/start-worker! mstore {:protocols {`intemporal.demo-vthread-recovery/ThreadActivity (->ThreadActivityImpl)}}))
3434

3535
(defn pprint-table [table]
3636
(clojure.pprint/print-table table))

0 commit comments

Comments
 (0)