This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-20
Channels
- # beginners (17)
- # boot (19)
- # chestnut (1)
- # cider (25)
- # clara (1)
- # cljs-dev (15)
- # cljsrn (10)
- # clojars (9)
- # clojure (182)
- # clojure-brasil (27)
- # clojure-dusseldorf (2)
- # clojure-gamedev (5)
- # clojure-germany (1)
- # clojure-greece (2)
- # clojure-italy (18)
- # clojure-poland (5)
- # clojure-romania (3)
- # clojure-russia (29)
- # clojure-serbia (6)
- # clojure-spec (9)
- # clojure-uk (77)
- # clojure-ukraine (1)
- # clojurescript (61)
- # cursive (5)
- # datomic (20)
- # defnpodcast (1)
- # emacs (10)
- # fulcro (2)
- # graphql (2)
- # hoplon (11)
- # lumo (4)
- # off-topic (50)
- # om (3)
- # onyx (26)
- # other-languages (39)
- # parinfer (2)
- # pedestal (5)
- # re-frame (32)
- # reagent (48)
- # rum (7)
- # shadow-cljs (10)
- # spacemacs (29)
- # sql (10)
- # unrepl (58)
- # vim (3)
Is there a counter API - a counter-as-a-service?
POST /api/counter?id=1234
Content-Length: n
5
each POST returns a new number?
Somebody must have built this
http://numeri.xyz First result on google for "counter as a service"
@mnzt, lol - I google for a bit but not with those search terms
I feel as if I just willed an API into existence - just by insisting that it must exist
that API is perfect đ
@carr0t let me guess - builder numbers?
I meant "build numbers", sorry
that's my use case - a source for sequential serial numbers to use as a build number, without worrying about atomic data store
Aah, no. We track changes to a database, and want to identify, given 2 arbitrary events both of which represent a change, which came first
So we get them in order, the first thing we do more or less is assign each event a unique incrementing ID, and from then on anywhere we need to compare events and know which came first we can, and ordering becomes much less of an issue
@pesterhazy why not use a uuid for that
UUID version 1 has a time-based component in it though. But an obvious solution would be to build this service yourself and just use increasing longs or whatever
Or if youâre using a database that all your services are talking to you could (ab)use that, by having an autoincrementing id đ
One of our legacy systems does that. It doesn't scale so well for large numbers of updates đ
I guess first requesting an id from a service also would be terribly slow with a large number of updates
The Clojure version basically grabs a 'block' of IDs per prefix, 10000 at a time, and hands them out as fast as requests can be made. If the service restarts or whatever we lose the remaining IDs from that block, but don't actually care
Each service uses a different prefix, so we only actually pay the cost in anything other than memory comparatively rarely
Can be a remote HTTP service, or just a local lib. But the local lib only works if you are sure you won't have 2 services using the same prefix
there are a bunch of java/clojure implementations and variations that are either coordinated over the network or uncoordinated (relying on something like ms precision over network time plus some number of bits for randomness)
We considered flake IDs but they didn't fit our requirements. It was a good few months ago now though so I can't immediately recall why
Interesting post: https://stackoverflow.com/a/5685869/6264
@carr0t > you make a network call to get a unique ID this is probably the reason you didnât choose this one (donât know if that Twitter thing can generate many at once)
I've used implementations that maintain a thread-safe collection of IDs in a background thread such that each request doesn't need to do a network call
I've also used them where there was no network coordination and relied on some number of bits identifying a shard or being something like timeset from an epoch + bits of randomness
Hey Everyone! We are looking for more content for our new and shiny Blog feature. See here: https://goo.gl/yBzwpj - As long as it is related to functional programming it will be relevant. So if you have a side project you are particularly proud of, or maybe you are a regular writer of a blog and fancy giving it a new audience, please don't hesitate to get in touch!
@borkdude I would have loved to use something that doesn't require coordination, but the requirements are that it has to be sequential
I need naming help. I'm building a GUI. I need a word to capture "state of entire screen" on a laptop/desktop, I would use the word "desktop" for a phone/tablet, what is the right word?
is that what 'desktop' means ? I thought it was this system where you had windows + you could drag them around
I'd say most people would use desktop
for 'initial screen with a wallpaper and some shortcuts'
alright, so I guess I really want is the phone/tablet version of "windowManager" - but that doesn't really exist since most phones/tablets either single task or splits creen at most
@qqq the current android has more arbitrary window management (not to say itâs intuitive to use, but itâs more than just split windows)
why not just âwindow-managerâ or âwindow-systemâ