I hereby claim:
- I am dvliman on github.
- I am dvliman (https://keybase.io/dvliman) on keybase.
- I have a public key ASBe4DkFe9qsB1j_Dc89k_Vd2euOfMD-Qz4FXTtbNRwTtwo
To claim this, I am signing this object:
;; File: src/some_app/middleware.clj | |
(defn open-gates [request] | |
true) | |
(def rules [{:pattern #"^/admin.*" | |
:handler admin-access | |
:redirect "/notauthorized"}, | |
{:pattern #"^\/vclass.*" | |
:handler user-access | |
:redirect "/notauthorized"}, | |
{:pattern #"^\/api.*" |
(defn ->Function | |
[f] | |
(reify java.util.function.Function | |
(apply [_ obj] (f obj)))) | |
(defn future-map | |
[cf f] | |
(.thenApply cf (->Function f))) | |
(defn future->ch | |
([cf] | |
(future->ch cf (async/chan 1) true)) |
(ns plokal.cheshire | |
(:require [cheshire.generate :refer [add-encoder]] | |
[cheshire.core :as json]) | |
(:import [com.fasterxml.jackson.core JsonGenerator] | |
(org.postgresql.geometric PGpoint))) | |
(add-encoder | |
PGpoint | |
(fn [^PGpoint data ^JsonGenerator jsonGenerator] | |
(.writeString jsonGenerator (json/generate-string {:type :Point |
go env | |
GOARCH="amd64" | |
GOBIN="/usr/local/go/bin" | |
GOCACHE="/Users/dv/Library/Caches/go-build" | |
GOEXE="" | |
GOFLAGS="" | |
GOHOSTARCH="amd64" | |
GOHOSTOS="darwin" | |
GOOS="darwin" | |
GOPATH="/Users/dv/go" |
interview-mind-map |
concurrency-models |
I hereby claim:
To claim this, I am signing this object:
I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.
RDBMS-based job queues have been criticized recently for being unable to handle heavy loads. And they deserve it, to some extent, because the queries used to safely lock a job have been pretty hairy. SELECT FOR UPDATE followed by an UPDATE works fine at first, but then you add more workers, and each is trying to SELECT FOR UPDATE the same row (and maybe throwing NOWAIT in there, then catching the errors and retrying), and things slow down.
On top of that, they have to actually update the row to mark it as locked, so the rest of your workers are sitting there waiting while one of them propagates its lock to disk (and the disks of however many servers you're replicating to). QueueClassic got some mileage out of the novel idea of randomly picking a row near the front of the queue to lock, but I can't still seem to get more than an an extra few hundred jobs per second out of it under heavy load.
So, many developers have started going straight t
package httplib | |
import ( | |
"net/http" | |
"net/http/httptest" | |
"net/url" | |
"testing" | |
"github.com/manyminds/api2go" |