Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,55 @@ on:
branches:
- master
pull_request:
schedule:
# monthly
- cron: "0 0 1 * *"
types:
- opened
- synchronize

env:
#bump to clear caches
ACTION_CACHE_VERSION: 'v1'

concurrency:
group: ${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test-clj:
strategy:
matrix:
java: ['11', '17', '21', '24']
runs-on: ubuntu-latest
java: ['11', '21', '25']
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}

- uses: DeLaGuardo/setup-clojure@13.4
with:
cli: 1.12.0.1530
cli: 1.12.3.1577

- run: clojure -M:dev -m promesa.tests.main

test-cljs:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '24'
java-version: '25'

- uses: actions/setup-node@v4
with:
node-version: '22.15.0'
node-version: '24.12.0'
cache: 'npm'

- uses: DeLaGuardo/setup-clojure@13.4
with:
cli: 1.12.0.1530
cli: 1.12.3.1577

- run: |
corepack enable
Expand All @@ -57,7 +62,7 @@ jobs:
yarn run test

test-bb:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog #

## Version 12.0.0-RC2 (Unreleased)

- Mark the `promesa.exec.csp` namespace no longer experimental and unify all
related protocols with the current naming style, removing the usage of `!`
suffix from protocol function names. This is tecnicaly a **breaking change**
but CSP was experimental and this kind of changes was expected. Still several
csp helpers are marked as experimental on docs and they continue have that
label.


## Version 12.0.0-RC1

BREAKING CHANGES:
Expand Down
9 changes: 7 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
:extra-paths ["test" "dev"]}

:repl
{:main-opts ["-m" "rebel-readline.main"]}
{:main-opts ["-m" "rebel-readline.main"]
:jvm-opts ["--sun-misc-unsafe-memory-access=allow"
"-XX:+UnlockExperimentalVMOptions"
"-XX:CompileCommand=blackhole,criterium.blackhole.Blackhole::consume"]}

:shadow-cljs
{:main-opts ["-m" "shadow.cljs.devtools.cli"]
:jvm-opts ["--sun-misc-unsafe-memory-access=allow"]}
:jvm-opts ["--sun-misc-unsafe-memory-access=allow"
"-XX:+UnlockExperimentalVMOptions"
"-XX:CompileCommand=blackhole,criterium.blackhole.Blackhole::consume"]}

:codox
{:extra-deps
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "promesa",
"version": "11.0",
"version": "12.0.0",
"description": "-",
"author": "-",
"license": "SEE LICENSE IN <LICENSE>",
Expand All @@ -10,9 +10,9 @@
},
"scripts": {
"test:watch": "clojure -M:dev:shadow-cljs watch test",
"test:compile": "clojure -M:dev:shadow-cljs compile test --config-merge '{:autorun false}'",
"test:build": "clojure -M:dev:shadow-cljs compile test --config-merge '{:autorun false}'",
"test:run": "node target/tests.js",
"test": "yarn run test:compile && yarn run test:run"
"test": "yarn run test:build && yarn run test:run"
},
"devDependencies": {
"source-map-support": "^0.5.21"
Expand Down
4 changes: 2 additions & 2 deletions src/promesa/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
(pt/-fnly
(pt/-promise p)
(fn [v exception]
(pt/-lock! lock)
(pt/-lock lock)
(try
(if exception
(when-not (:resolved? @state)
Expand All @@ -409,7 +409,7 @@
#?(:clj (c/run! pt/-cancel! pending))
(resolve v))))
(finally
(pt/-unlock! lock)))))))))))
(pt/-unlock lock)))))))))))

(defn wait-all*
"Given an array of promises, return a promise that is fulfilled when
Expand Down
4 changes: 2 additions & 2 deletions src/promesa/exec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,6 @@
{:no-doc true
:deprecated true}
([o]
(pt/-close! o))
(pt/-close o))
([o reason]
(pt/-close! o reason)))
(pt/-close o reason)))
10 changes: 5 additions & 5 deletions src/promesa/exec/bulkhead.clj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
(try
(.run ^Runnable f)
(finally
(psm/release! semaphore :permits 1)
(psm/release semaphore :permits 1)
(log "cmd:" "Task/run" "f:" (hash f)
"task:" (hash this)
"permits:" (.availablePermits ^Semaphore semaphore)
Expand Down Expand Up @@ -121,10 +121,10 @@
(log "cmd:" "Bulkhead/run" "queue:" (.size queue) "permits:" (.availablePermits semaphore))
(loop []
(log "cmd:" "Bulkhead/run$loop1" "queue:" (.size queue) "permits:" (.availablePermits semaphore))
(when-let [task (when (pt/-try-acquire! semaphore)
(when-let [task (when (pt/-try-acquire semaphore)
(if-let [task (-poll queue)]
task
(pt/-release! semaphore)))]
(pt/-release semaphore)))]
(log "cmd:" "Bulkhead/run$loop2" "task:" (hash task) "available-permits:" (.availablePermits semaphore))
(.execute ^Executor executor ^Runnable task)
(recur)))))
Expand Down Expand Up @@ -170,11 +170,11 @@
(throw (ex-info hint props))))

(try
(if (psm/acquire! semaphore :permits 1 :timeout timeout)
(if (psm/acquire semaphore :permits 1 :timeout timeout)
(try
(.run ^Runnable f)
(finally
(psm/release! semaphore)))
(psm/release semaphore)))
(let [props {:type :bulkhead-error
:code :capacity-limit-reached
:timeout timeout}]
Expand Down
Loading
Loading