Fork me on GitHub
#off-topic
<
2018-11-06
>
quadron14:11:51

so i am writing a worker thread that reads from a channel and does stuff, does it matter performance-wise (or $OTHER-wise) how the thread loops? see below:

quadron14:11:50

so the question is: is it OK to just wrap the above in a (while true ...) or should I introduce sleep or something?

Jan K14:11:29

@veix.q5 You should probably use <! in a go block or <!! instead of poll!

đź‘Ť 4
enforser14:11:30

take a look at this example @veix.q5 - I think it accomplishes something similar to what you are doing! https://clojuredocs.org/clojure.core.async/go-loop#example-542c88e3e4b05f4d257a297b

đź‘Ť 4
rgb-one16:11:24

I think I'll just work with REST. If I have any GraphQL questions I'll ask @lady3janepl

đź‘Ť 4
rgb-one17:11:50

What advantages and drawbacks do you observe from including relationships as a URL (https://inspector.swagger.io/builder?url=https%3A%2F%2Fswapi.co%2Fapi%2Fpeople) as opposed to just pulling the actual relationship data (i.e. https://something.co/api/people instead of people: [{ name: 'Something',... }, {...}])? One advantage is that the url is less information to pull so it faster. Another is that the all the relationship data may not be used with each request so if a particular relationship is needed the URL can be queried. On the disadvantages, when you do want all the relationship data, all the URL's have to be queried as opposed to having the data available from the initial request. Why would you use a URL for relationships instead of just pulling the related data?

valtteri18:11:13

It’s very hard to provide general advice other than trying to figure out: a) what are the things you are trying to do b) what data do you need for each use-case Based on that think how to build your domain model to match your needs. f you’re building let’s say a public API and you don’t know exactly what your consumers use cases will be, you want to provide more flexibility. If you’re building an app about families and you’re querying parents, you probably want to get their children at one go. Often the case is that you don’t really really know answers to a) and b). Then you make a guess and a little experiment to see how it turns out and prepare to adjust when you get more information and learn. In these situations it’s nice to have more flexibility. So the answer to your question about drawbacks and advantages of using URL-refs in entities: it fits some cases better than others.