Skip to content

Instantly share code, notes, and snippets.

View yenda's full-sized avatar
💭
When the Facts Change, I Change My Mind. What Do You Do, Sir?

Eric Dvorsak yenda

💭
When the Facts Change, I Change My Mind. What Do You Do, Sir?
View GitHub Profile
@awwx
awwx / transmute.md
Last active May 1, 2024 08:25
transmute

Here's a mechanism for transforming a discrete input flow into an output flow where the internal process state can be implemented with loop/recur. As an example I provide an implementation of "batching with both a maximum size and a maximum delay" referenced in leonoel/missionary#109.

Transforming discrete flows

A common pattern for discrete flows is that we want to create an output flow from an input flow, where:

@awwx
awwx / mobserve.cljc
Last active May 4, 2024 11:19
observe Missionary task and flow events
;; Newer version at https://gist.github.com/awwx/6d02e6ea702bdc499bcf847e9b9bb98f
(ns mobserve
(:require
[missionary.core :as m]))
;; Encapsulate differences between Clojure and ClojureScript
;; on how IFn and IDeref are implemented.
#?(:clj
@dustingetz
dustingetz / missionary-concept-map.md
Last active April 10, 2024 10:58
Missionary concept map

Missionary concept map

Missionary primitives fit into three categories:

Effect descriptions = pure functional programming which is about trees not graphs

  • continuous flow, m/?< (switch)
  • m/watch, m/latest, m/cp
  • m/observe
  • m/reductions, m/relieve
@janherich
janherich / current_situation.clj
Last active May 29, 2018 22:40
Current situation
;; All our model functions adhere to simple interface, taking any number of arguments,
;; but always the `:cofx` map as an last argument and producing map of effects (or nothing)
;; as result:
(defn effects-fn [arg1 arg2 {:keys [db] :as cofx}]
{:db (update db :some-key arg1)
:http-call ...})
;; We have both `merge-fx` macro and `merge-effect` functions at our disposal
;; Whenever we do static merging of effects, we use the former:
(defn final-effects-fn [cofx]