Skip to content

Commit

Permalink
Merge pull request #196 from nilenso/prepare-0.6.0-release
Browse files Browse the repository at this point in the history
Prepare Goose for 0.6.0 release
  • Loading branch information
olttwa authored Oct 4, 2024
2 parents c2bfa66 + 8634ffe commit 656fea9
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 17 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Changed
### Fixed

## [0.6.0] - 4th-Oct-2024

### Added
- Formatting check in CI and guidelines

### Changed
- References of Periodic jobs to Cron jobs

### Fixed

## [0.5.3] - 16th-Sept-2024

### Added
- View schedule and periodic jobs in console
- View Scheduled and Cron jobs in console
- Add dark theme
- Poll jobs
### Changed
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Thank you for investing your time in contributing to our project!

Before you start contributing, we're presuming you've gone through all the [architecture-decisions](https://github.com/nilenso/goose/tree/main/architecture-decisions) & had a discussion with the maintainers.

Request for feedback
--------

We plan to release **Goose 1.0.0** on **February 1st, 2025**, marking API stability and ensuring backward-compatibility, with no downtime during upgrades.

**We welcome feedback from current and new users**, especially if you’d like to request features or suggest changes to the API or implementation before the 1.0.0 release. Please share your thoughts via [GitHub Issues](https://github.com/nilenso/goose/issues/new) or the [Clojurians Slack](https://clojurians.slack.com/channels/goose).

Installation
--------

Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
Goose
=========
[![Test & Lint Workflow](https://github.com/nilenso/goose/actions/workflows/test_lint.yml/badge.svg)](https://github.com/nilenso/goose/actions/workflows/test_lint.yml)
[![Test & Lint Workflow](https://github.com/nilenso/goose/actions/workflows/fmt_test_lint.yml/badge.svg)](https://github.com/nilenso/goose/actions/workflows/fmt_test_lint.yml)
[![Clojars Project](https://img.shields.io/clojars/v/com.nilenso/goose.svg)](https://clojars.org/com.nilenso/goose)
[![cljdoc badge](https://cljdoc.org/badge/com.nilenso/goose)](https://cljdoc.org/d/com.nilenso/goose)

The Next-Level background job processing library for Clojure.
> **Simple. Pluggable. Reliable. Extensible. Scalable.**
Announcement 🔈
---------
We are excited to announce that **5 companies** are using Goose successfully and reliably in production environments. With the release of the [Jobs Management Console](https://github.com/nilenso/goose/wiki/Console), Goose has reached a level of maturity, offering a feature-rich, stable, and production-ready background job processing solution.

We plan to release **Goose 1.0.0** on **February 1st, 2025**, marking API stability and ensuring backward-compatibility, with no downtime during upgrades.

We welcome feedback from current and new users, especially if you’d like to request features or suggest changes to the API or implementation before the 1.0.0 release. Please review our [Architecture Decisions](https://github.com/nilenso/goose/tree/main/architecture-decisions) and [Wiki](https://github.com/nilenso/goose/wiki) for more context, and share your thoughts via [GitHub Issues](https://github.com/nilenso/goose/issues/new) or the [Clojurians Slack](https://clojurians.slack.com/channels/goose).

Performance
---------
Please refer to the [Benchmarking section](https://github.com/nilenso/goose/tree/main/perf).
Expand All @@ -20,7 +28,7 @@ Features
- [Batch Jobs](https://github.com/nilenso/goose/wiki/Batch-Jobs)
- [Cron Jobs](https://github.com/nilenso/goose/wiki/Cron-Jobs)
- [Error Handling & Retries](https://github.com/nilenso/goose/wiki/Error-Handling-&-Retries)
- [Console](https://github.com/nilenso/goose/wiki/Console)
- [Jobs management Console](https://github.com/nilenso/goose/wiki/Console)
- Extensible using [Middlewares](https://github.com/nilenso/goose/wiki/Middlewares)
- Concurrency & Parallelism friendly
- ... more details in [Goose Wiki](https://github.com/nilenso/goose/wiki)
Expand All @@ -32,10 +40,10 @@ Getting Started
### Add Goose as a dependency
```Clojure
;;; Clojure CLI/deps.edn
com.nilenso/goose {:mvn/version "0.5.3"}
com.nilenso/goose {:mvn/version "0.6.0"}

;;; Leiningen/Boot
[com.nilenso/goose "0.5.3"]
[com.nilenso/goose "0.6.0"]
```

### Client
Expand Down
16 changes: 10 additions & 6 deletions architecture-decisions/pages/cron-jobs.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
ADR: Periodic Jobs
ADR: Cron Jobs
=============

Rationale
---------

### Nomenclature

While "Periodic Jobs" is technically a more accurate term for jobs that execute recurringly at fixed intervals (as reflected in dictionary definitions of "periodic" versus "cron"), we opted to use the term **Cron jobs** for its familiarity and conciseness. This decision prioritizes ease of understanding for the broader developer community.

### Redis
- Implementation details:
- `:cron-name` is the unique identifier for a Periodic Job
- `:cron-name` is the unique identifier for a Cron Job
- We've separated Job description from the actual Job itself
- Goose stores the description in a hash-set by the key of its `:cron-name`
- After storing it in hash-set, Goose creates an entry in a sorted-set with score of next runtime
- When a job is due, Goose creates a Job from the description & enqueue it to ready-queue
- Add another entry in sorted-set for next runtime
- Limitations:
- The most frequently a job can be run periodically is every minute
- The most frequently a job can be run recurringly is every minute
- Backfill: In case workers weren't running, Goose will backfill only 1 cron job, instead of n missed jobs
- There's no expiry on Periodic Jobs, hence no need for renewal/re-registration. Until the fixed count feature is implemented, cron job can be stopped/deleted only using API.
- There's no expiry on Cron Jobs, hence no need for renewal/re-registration. Until the fixed count feature is implemented, a cron job can be stopped/deleted only using API.
- Versioning using enqueue timestamp is a good-enough feature & doesn't need a dedicated versioning stamp

### RabbitMQ

- Periodic jobs feature cannot be implemented in RabbitMQ because of:
- Cron jobs feature cannot be implemented in RabbitMQ because of:
- Lack of a persistent SET/GET data structure
- Lack of querying/updating/deleting jobs inside a queue
- Unique registration can be done using `noxdafox/rabbitmq-message-deduplication` plugin
- However, deleting a job isn't possible
- If RMQ had a way to set/get data, that would make periodic jobs possible
- If RMQ had a way to set/get data, that would make implementing cron jobs possible
2 changes: 1 addition & 1 deletion architecture-decisions/pages/rabbitmq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ADR: Periodic Jobs
ADR: RabbitMQ
=============

Rationale
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.nilenso</groupId>
<artifactId>goose</artifactId>
<version>0.5.3</version>
<version>0.6.0</version>
<name>goose</name>
<url>https://github.com/nilenso/goose</url>

Expand Down
2 changes: 1 addition & 1 deletion src/goose/broker.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(enqueue [this job] "Enqueues a Job for async execution.")
(enqueue-batch [this batch] "Enqueues a Batch of Jobs for async execution.")
(schedule [this schedule-epoch-ms job] "Schedules a Job for execution at given epoch-ms.")
(register-cron [this cron-opts job-description] "Registers a function for periodic execution in cron-jobs style.")
(register-cron [this cron-opts job-description] "Registers a function for recurring execution in cron-jobs style.")

;; worker/consumer
(start-worker [this worker-opts] "Starts a worker process that does multiple things:
Expand Down
6 changes: 3 additions & 3 deletions src/goose/client.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns goose.client
"Functions for executing job in async, scheduled or periodic manner."
"Functions for executing jobs in async, scheduled, batches or cron fashion."
(:require
[goose.batch :as batch]
[goose.broker :as b]
Expand Down Expand Up @@ -129,7 +129,7 @@
(enqueue opts (u/sec+current-epoch-ms sec) execute-fn-sym args))

(defn perform-every
"Registers a function for periodic execution in cron-jobs style.\\
"Registers a function for recurring execution in cron-jobs style.\\
`perform-every` is idempotent.\\
If a cron entry already exists with the same name, it will be overwritten with new data.
Expand All @@ -155,7 +155,7 @@
### Usage
```Clojure
(let [cron-opts {:cron-name \"my-periodic-job\"
(let [cron-opts {:cron-name \"my-cron-job\"
:cron-schedule \"0 10 15 * *\"
:timezone \"US/Pacific\"}]
(perform-every client-opts cron-opts `send-emails \"subject\" \"body\" [:user-1 :user-2]))
Expand Down

0 comments on commit 656fea9

Please sign in to comment.