Fork me on GitHub
#mount
<
2016-04-20
>
jethroksy01:04:46

quick question: can mount :start and :stop operations contain side effects?

tolitius02:04:38

@jethroksy: you mean a side effect within a start function?

tolitius02:04:46

i.e.

(defn start-foo []
  (info "side effect")
  (do-real-work-to-start-foo))

(defstate foo :start (start-foo))
?

jethroksy02:04:59

yeah exactly that

tolitius02:04:11

yep, that'll work

jethroksy02:04:23

alright thanks!

jethroksy02:04:38

trying to be careful by limiting where side effects should be

tolitius02:04:57

sure. it just calls the function and binds to the return value, so anything you have inside the function will be done

tolitius02:04:24

right. usually logging is a good side effect to have simple_smile

tolitius02:04:41

if we talking pragmatic vs. dogmatic

tolitius02:04:14

unless of course the piece you are working on is a logging lib

jethroksy02:04:25

haha nah it's not it's just a simple web app

tolitius02:04:37

yea, I love my logging

tolitius02:04:40

keeps me in check

jethroksy02:04:59

yeah i was getting a little annoyed at how little beanstalk logs told me

tolitius02:04:34

can you set its classes to trace, or it just does not have logging?

tolitius02:04:48

(I have not used beanstalk)

jethroksy02:04:13

it didn't have much logging

jethroksy02:04:26

the other thing is I couldn't tell which docker container was the current one from the logs

jethroksy02:04:40

so I had tons of logs, but not sure which was from the current app...

jethroksy02:04:54

it used to show docker ps, not sure why that stopped

tolitius02:04:42

hm.. just read a bit about beanstalk. interesting, probably a good idea to get to know it simple_smile