Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eronalves/compojure-atomicity
Project to test Clojure atomicity with ring and compojure
https://github.com/eronalves/compojure-atomicity
Last synced: 1 day ago
JSON representation
Project to test Clojure atomicity with ring and compojure
- Host: GitHub
- URL: https://github.com/eronalves/compojure-atomicity
- Owner: eronalves
- Created: 2017-07-16T14:13:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-23T21:52:37.000Z (over 7 years ago)
- Last Synced: 2024-11-11T23:38:33.426Z (2 months ago)
- Language: Clojure
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Atomicity Clojure Compojure
Simple project to test Clojure [atomicity](https://clojure.org/reference/atoms) with compojure and ring to serve an API blocking duplicate operations.
## Prerequisites
You will need [Leiningen][] 2.0.0 or above installed.
[leiningen]: https://github.com/technomancy/leiningen
## Running
To start a web server for the application, run:
lein ring server
orlein ring server-headless
## TestingThe API has the following endpoints:
localhost:3000/add/:number
localhost:3000/has-number/:numberThe endpoint add will add the number on the params in a PersistentQueue Atom using swap!.
When call the same endpoint with same number the add will be blocked.And the endpoint has-number verify if the number was added.
## License
Copyright © 2017 MIT