Skip to content

Instantly share code, notes, and snippets.

@iantruslove
Last active September 10, 2015 23:49
Show Gist options
  • Save iantruslove/ea6f452891d8ec76f378 to your computer and use it in GitHub Desktop.
Save iantruslove/ea6f452891d8ec76f378 to your computer and use it in GitHub Desktop.
Den of Clojure | Real Projects | Jupiter

Den of Clojure

REAL PROJECTS

Jupiter

Den of Clojure, 2015-09-10

Ian Truslove@iantrusloveSonian.com

Topics

  • Overview
  • Lifecycle
  • Components
  • jupiterctls with Carousel defadmins
  • Config with Carica
  • Embedded webservers

Overview

  • Sonian
  • Emails
  • Analytics
  • Jupiter

Lifecycle and Deployment

  • Jupiter: It’s Just a JAR
    • We use lein tar for packaging (very similar to uberjar)
    • lein-tar
  • Shell script to start server
  • jupiterctl shell script interface for shutdown (more later)
  • System model:
    • One “master” per JVM
    • Thread pool for workers
    • Queue for job management (PostgreSQL)
    • Zookeeper for distributed locks

Components

For managing and composing system state

  • Based on Stuart Sierra’s component
  • Multimethod dispatch:
    • start
    • stop
    • status
  • All state contained in one atom
  • Worker system plus ad-hoc test-time systems

jupiterctls with Carousel defadmins

  • Carousel runs a socket server
  • defadmin sets up socket-invokable functions
  • jupiterctl is a simple wrapper around nc
  • Auto-documented via docstrings
  • Interesting jupiterctls:
    • help
    • status
    • config
    • repl
    • stop

Config with Carica

Embedded webservers

Q&A

You must got questions, right?

This document:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment