Liking cljdoc? Tell your friends :D

boundary.jobs.shell.adapters.in-memory

In-memory job queue implementation for development and testing.

Uses Clojure atoms and data structures for job queuing. This adapter is suitable for:

  • Local development without Redis
  • Fast unit testing
  • CI/CD pipelines
  • Learning and tutorials

NOT suitable for:

  • Production use (no persistence, single-process only)
  • Distributed systems (not shared across processes)
  • High-volume job processing (limited by memory)

State is stored in atoms with the following structure:

  • jobs: Map of job-id -> job
  • queues: Map of queue-name -> priority-map of [priority job-ids]
  • scheduled: Sorted set of [execute-at job-id] pairs
  • failed: Vector of failed job-ids
  • stats: Map of queue-name -> statistics
In-memory job queue implementation for development and testing.

Uses Clojure atoms and data structures for job queuing. This adapter is
suitable for:
- Local development without Redis
- Fast unit testing
- CI/CD pipelines
- Learning and tutorials

NOT suitable for:
- Production use (no persistence, single-process only)
- Distributed systems (not shared across processes)
- High-volume job processing (limited by memory)

State is stored in atoms with the following structure:
- jobs: Map of job-id -> job
- queues: Map of queue-name -> priority-map of [priority job-ids]
- scheduled: Sorted set of [execute-at job-id] pairs
- failed: Vector of failed job-ids
- stats: Map of queue-name -> statistics
raw docstring

clear-all-jobs!clj

(clear-all-jobs! state)

Clear all jobs from state. Useful for testing.

Args: state - InMemoryState instance

Clear all jobs from state. Useful for testing.

Args:
  state - InMemoryState instance
sourceraw docstring

create-in-memory-job-queueclj

(create-in-memory-job-queue)
(create-in-memory-job-queue state)

Create in-memory job queue.

Args: state - InMemoryState instance (optional, creates new if not provided)

Returns: InMemoryJobQueue implementing IJobQueue

Create in-memory job queue.

Args:
  state - InMemoryState instance (optional, creates new if not provided)

Returns:
  InMemoryJobQueue implementing IJobQueue
sourceraw docstring

create-in-memory-job-statsclj

(create-in-memory-job-stats)
(create-in-memory-job-stats state)

Create in-memory job stats.

Args: state - InMemoryState instance (optional, creates new if not provided)

Returns: InMemoryJobStats implementing IJobStats

Create in-memory job stats.

Args:
  state - InMemoryState instance (optional, creates new if not provided)

Returns:
  InMemoryJobStats implementing IJobStats
sourceraw docstring

create-in-memory-job-storeclj

(create-in-memory-job-store)
(create-in-memory-job-store state)

Create in-memory job store.

Args: state - InMemoryState instance (optional, creates new if not provided)

Returns: InMemoryJobStore implementing IJobStore

Create in-memory job store.

Args:
  state - InMemoryState instance (optional, creates new if not provided)

Returns:
  InMemoryJobStore implementing IJobStore
sourceraw docstring

create-in-memory-jobs-systemclj

(create-in-memory-jobs-system)

Create complete in-memory jobs system with shared state.

Returns: Map with :queue, :store, :stats sharing same state

Create complete in-memory jobs system with shared state.

Returns:
  Map with :queue, :store, :stats sharing same state
sourceraw docstring

get-all-jobsclj

(get-all-jobs state)

Get all jobs in state. Useful for testing.

Args: state - InMemoryState instance

Returns: Map of job-id -> job

Get all jobs in state. Useful for testing.

Args:
  state - InMemoryState instance

Returns:
  Map of job-id -> job
sourceraw docstring

get-scheduled-jobsclj

(get-scheduled-jobs state)

Get all scheduled jobs. Useful for testing.

Args: state - InMemoryState instance

Returns: Sorted set of {:execute-at :job-id}

Get all scheduled jobs. Useful for testing.

Args:
  state - InMemoryState instance

Returns:
  Sorted set of {:execute-at :job-id}
sourceraw docstring

process-scheduled-jobs-internal!clj

(process-scheduled-jobs-internal! queue)

Move scheduled jobs that are due to execution queues.

This should be called periodically (e.g., every 5 seconds) by a worker.

Args: queue - InMemoryJobQueue instance

Returns: Number of jobs moved to execution queues

Move scheduled jobs that are due to execution queues.

This should be called periodically (e.g., every 5 seconds) by a worker.

Args:
  queue - InMemoryJobQueue instance

Returns:
  Number of jobs moved to execution queues
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close