Fork me on GitHub
#yada
<
2017-01-27
>
stijn09:01:56

question on bringing a database in the mix in yada resources:

stijn09:01:32

how would you manage a datomic database value in your resources? Let's say you need the db value in multiple interceptors (auth, properties, response). You probably want to insert an interceptor that updates the context before all that stuff happens?

stijn09:01:54

or is the general advice to do this in 'properties'?

malcolmsparks10:01:34

We establish the database value and assoc into the req context, using an interceptor precise because its used in auth. @stijn

stijn10:01:15

makes sense. in our case we do auth with an external system, so assoc'ing it in properties is fine

malcolmsparks11:01:39

If you want to know more about this interceptor, it's discussed in my blog article today: https://juxt.pro/blog/posts/live-programming-websites.html

malcolmsparks11:01:45

Retweets welcome!

stijn12:01:47

really interesting read!

stijn12:01:53

integrant's suspend / resume functionality got me thinking on the same line, where you can update e.g. your handler without restarting the webserver

stijn12:01:44

one concern is, how can you guarantee everything still works when your server fails, the node dies, or becomes unusable and you have to restart everything from scratch?

malcolmsparks13:01:30

I saw that. Really want to look at James's new stuff

dominicm19:01:08

@stijn component can do that via another library of his :)