Fork me on GitHub
#untangled
<
2016-06-09
>
jasonjckn18:06:23

is the untangled server "thread per request" model? e.g. if I make an elastic search blocking query for every single remote data fetch, will this scale up? or quickly consume a thread pool

tony.kay18:06:28

U.S. is using httpkit. See those docs.

tony.kay18:06:32

Eventually that will likely be pluggable. Any ring-based server will work. At the moment, httpkit seemed a reasonable choice for a default.

jasonjckn18:06:21

cool i'll check out docs

kenbier21:06:40

we ran into a bug today where a migration was being dropped because it had the same timestamp as an existing migration. perhaps its worth throwing an exception or warning if that is the case? https://github.com/untangled-web/untangled-datomic/blob/master/src/untangled/datomic/schema.clj#L202

jasonjckn21:06:15

How do I fix my query so that props contained the loaded data?

jasonjckn21:06:18

(defuii SearchTab '[:which-tab
                    :content
                    [:search-results _]]
  Object
  (render [T]
    (div
     (form-control-text {:type "text"
                         :placeholder "enter your search"
                         :onKeyEnter #(load-data T '[:search-results])
                         #_ #(transact! T `[(app/search {:query ~%})])})
     (code (prn-str (props T))))))

jasonjckn21:06:51

oh sorry, there's some macro magic there, the query is

[:which-tab
                    :content
                    [:search-results _]]

jasonjckn21:06:19

so essentially i'm just trying to read root key :search-results while writing a query expression that isn't in Root component

jasonjckn21:06:23

ok, so I got an improvement when I changed server api to

jasonjckn21:06:32

(defmethod api-read :search-results [env key params]
  {:value {:the ["result0"]}})

jasonjckn21:06:04

would have preferred {:value ["result0"]}

jasonjckn21:06:11

but that doesn't work

jasonjckn21:06:03

here's the props for SearchTab now

jasonjckn21:06:05

{:which-tab :search, :content "Main", :search-results {:ui/fetch-state nil, :the ["result0"]}}

jasonjckn21:06:34

next, i tried changing the query to

(defuii SearchTab '[:which-tab
                    :content
                    [:search-results :the]]

jasonjckn21:06:56

which resulted in the props for SearchTab being `{:which-tab :search, :content "Main", [:search-results :the] [nil]}

jasonjckn21:06:09

i guess I need a join, let me try that

jasonjckn21:06:24

this is what I have

jasonjckn21:06:43

(defuii SearchTab '[:which-tab
                    :content
                    {[:search-results :global] [:items]}]
  Object
  (render [T]
    (div
     (form-control-text {:type "text"
                         :placeholder "enter your search"
                         :onKeyEnter #(load-data T '[:search-results])
                         #_ #(transact! T `[(app/search {:query ~%})])})
     (code (prn-str (props T))))))
and on the backend API I have
(defmethod api-read :search-results [env key params]
  {:value {:global {:items ["result0"]}}})

jasonjckn21:06:19

is the :global and :items is redundant keys, search-results is a singleton with type vector

jasonjckn21:06:31

not sure if there's a more concise way to do this