Fork me on GitHub
#yada
<
2017-01-06
>
danielcompton07:01:48

Is there a recommended pattern for database access with Yada? Standard JDBC calls will be blocking right?

stijn10:01:40

@danielcompton wrap the call to jdbc in a manifold future?

stijn10:01:59

i think the aleph docs say to avoid blocking calls on the handler threads

malcolmsparks10:01:03

Wrap in a future. If you have an async api then use a promise

stijn10:01:04

or you can specify an executor with a big enough thread pool when starting the server

stijn10:01:46

but that way you will run every request on that executor

stijn10:01:24

whereas with wrapping the jdbc call in a future, you can specify an executor that is only used for db calls

vinnyataide20:01:08

hello I'm getting this message error when I import yada

data: {:file "cheshire\\core.clj", :line 1}

       java.lang.Exception: namespace ’cheshire.factory’ not found
data: {:file "cheshire\\core.clj", :line 1}

       java.lang.Exception: namespace ’cheshire.factory’ not found

malcolmsparks20:01:13

Can you provide more info @vinnyataide

vinnyataide20:01:51

k lemme copy the stack trace

vinnyataide20:01:36

besides the boot error lines there's this line that I think has something to do with it

error in process sentinel: Could not start nREPL server: Warning: version conflict detected: org.clojure/clojure version changes from 1.2.0 to 1.9.0-alpha14
Warning: version conflict detected: org.clojure/clojure version changes from 1.2.0 to 1.9.0-alpha14

vinnyataide20:01:14

this is my deps

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"resources"}
 :dependencies '[[org.clojure/clojure "1.9.0-alpha14"]
                 [org.clojure/clojurescript "1.9.293"]
                 [org.clojure/tools.nrepl "0.2.12"]
                 [org.clojure/core.async "0.2.395"]
                 [org.clojure/test.generative "0.5.2"]
                 [com.datomic/datomic-free "0.9.5544"]
                 [com.stuartsierra/component "0.3.2"]

                 [aero "1.0.1"]
                 [adzerk/boot-cljs "1.7.228-2" :scope "test"]
                 [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
                 [adzerk/boot-reload "0.4.13" :scope "test"]
                 [reloaded.repl "0.2.3" :scope "test"]
                 [com.cemerick/piggieback "0.2.2-SNAPSHOT" :scope "test"]
                 [weasel "0.7.0" :scope "test"]

                 [org.omcljs/om "1.0.0-alpha47"]

                 [yada "1.2.0"]
                 [bidi "2.0.16"]
                 [aleph "0.4.1"]])

malcolmsparks20:01:25

What are you trying to do? Are you just trying to launch boot?

vinnyataide20:01:12

(ns om-learn.server
  (:require [yada.yada :as yada]))
I restarted the repl because this error was happening when I ran this line

vinnyataide20:01:36

now the message appears on repl start since I'm running the code inside my component

vinnyataide20:01:28

I'm following line by line of your edge build.boot, I've started my datomic instance and am trying to put my webserver to work

vinnyataide20:01:56

just to learn how to build boot systems as the edge project do

malcolmsparks20:01:50

Do you have a repo I can clone and take a look?

vinnyataide20:01:01

yeah, lemme push the changes

malcolmsparks20:01:30

Cool. Sorry, this could be a result of recent yada changes. I'll investigate

vinnyataide20:01:36

it has some portuguese words in the comments, just almost all direct translations

vinnyataide20:01:17

I'm relatively new to the tecnologies, could be a rookie mistake too