Fork me on GitHub

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:


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

take a look at this example @veix.q5 - I think it accomplishes something similar to what you are doing!

đź‘Ť 4

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

đź‘Ť 4

What advantages and drawbacks do you observe from including relationships as a URL ( as opposed to just pulling the actual relationship data (i.e. 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?


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.