This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-01
Channels
- # aleph (1)
- # architecture (7)
- # aws (1)
- # beginners (52)
- # boot (3)
- # cider (27)
- # cljs-dev (9)
- # cljsrn (16)
- # clojure (82)
- # clojure-dev (75)
- # clojure-italy (14)
- # clojure-nl (11)
- # clojure-spec (10)
- # clojure-uk (31)
- # clojurescript (49)
- # core-async (13)
- # datascript (11)
- # datomic (15)
- # duct (11)
- # emacs (8)
- # fulcro (46)
- # heroku (2)
- # jobs-discuss (27)
- # jobs_rus (1)
- # juxt (25)
- # keechma (1)
- # off-topic (59)
- # om (2)
- # pedestal (4)
- # portkey (113)
- # portland-or (1)
- # re-frame (14)
- # reagent (11)
- # shadow-cljs (278)
- # vim (2)
- # yada (2)
Curious if anyone has an approach/example for retrying failed events when using the async flow model
I've moved on from using async-flow to a state machine model
For example - I have a sync state machine that looks like this
(def state-machine
"Sync state machine"
{nil {:sync/init :ready}
:ready {:sync/fetch-order :fetching-order}
:fetching-order {:fetch-order/success-no-client-changes :ready
:fetch-order/failure-disconnected :disconnected
:fetch-order/failure-token-expired :warning
:sync/save-order :saving-order
:sync/conflict :warning}
:warning {:warning/accept :ready}
:saving-order {:save-order/success-no-changes :ready
:save-order/success-more-changes :throttling
:save-order/failure-disconnected :disconnected
:save-order/failure-token-expired :warning}
:throttling {:sync/fetch-order :fetching-order}
:disconnected {:sync/fetch-order :fetching-order}})
I explicitly keep track of what state I'm in, and retry using a backoff interval
I took the idea http://blog.cognitect.com/blog/2017/5/22/restate-your-ui-using-state-machines-to-simplify-user-interface-development and kind of ran with it
Another async-flow solutioning question: say I have 3 async steps, each of which update an object which the next step will need - what are some approaches for passing that data 'through the pipe'?
@tees I’ve used free-form and re-frame-forms. They’re both ok, depending on your needs.
That’s a good question @pandeiro, i’m not sure, I’d probably just stick the ‘intermediate results’ in the db, but of course, you probably can’t guarantee that something else doesn’t muck with it
@pandeiro You might want to check out kee-frame event chaining: https://github.com/ingesolvoll/kee-frame#event-chains
@tees See https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
@pandeiro there is a PR for this in re-frame-async-flow
repo which is, as yet, unapplied by me