Fork me on GitHub
#duct
<
2018-02-16
>
dadair00:02:40

What is the proper way of responding from an aleph websocket handler using ataraxy? e.g.,

(defmethod ig/init-key ::connect [_ {:keys [db logger]}]
  (fn [req]
    ;; wrap in [::response/X ..]?
    (-> (d/let-flow [socket (http/websocket-connection req)]
          (s/connect socket socket))
        (d/catch (fn [_] non-websocket-request)))))

weavejester00:02:45

@dadair It’s just a Ring handler, so the normal rules should apply.

mariusz_jachimowicz19:02:04

I released module for auto loading migrations from folder, don't need to configure them manually https://github.com/mariusz-jachimowicz-83/duct-migrations-auto-cfg

weavejester19:02:21

@mariusz_jachimowicz That looks useful - but it doesn’t have to be a module. You can just write it as a regular key.

weavejester19:02:23

e.g. {:duct.migrator/ragtime {:migrations #ig/ref :example.migrations/from-dir}}

weavejester19:02:53

The :migrations key is a vector, so you just need to ensure that the key returns a vector of migrations.

mariusz_jachimowicz19:02:54

I thought that this ref will try to get string content from this url

weavejester19:02:37

@mariusz_jachimowicz The ref is replaced with whatever is returned from init-key, so if you return a vector of migrations, then you get a vector of migrations.

mariusz_jachimowicz20:02:05

@weavejester aaa ok I understand now. Indeed. I will check it.

mariusz_jachimowicz20:02:16

thx for the tip 😄

mariusz_jachimowicz21:02:36

Now I am thinking about making some modules for microservices architecture. Something similar to Spring Cloud or https://github.com/otto-de/tesla-microservice - allow to specify multiple jetty instances + multiple migrators + multiple dbs (connection pools) + Zookeeper module + ...