I hereby claim:
- I am betawaffle on github.
- I am betawaffle (https://keybase.io/betawaffle) on keybase.
- I have a public key ASCb-r2xz37rjxp4POJ0VKHYiztV3uwpUKrIsFgzTKFvSAo
To claim this, I am signing this object:
package jscan | |
import ( | |
"bytes" | |
"errors" | |
"fmt" | |
) | |
var ( | |
errIncomplete = errors.New("json: incomplete token") |
package main | |
import ( | |
"bytes" | |
"crypto/sha1" | |
"encoding/hex" | |
"errors" | |
"fmt" | |
"io" | |
"io/ioutil" |
I hereby claim:
To claim this, I am signing this object:
Q: How do I remove a node from an etcd cluster? | |
A: We don't have a way to do that yet, but that functionality is slotted for the 0.3.0 series as part of the Cluster Management API. | |
Q: Can I count on a value I read from the slave always being a value that was at some point the current "true" value on the master? | |
A: Yes. Writes never go through the slaves. | |
Q: When reading from a slave that is in a minority partition, can I still read that (potentially old) value? | |
A: Yes. | |
Q: If each CoreOS machine has an etcd in the same cluster, doesn't that limit the number of CoreOS machines you can have? |
Thread.new([1].to_enum) { |e| e.next while true }.join |
class Timers | |
def initialize | |
@timers = SortedSet.new | |
@mutex = Mutex.new | |
@mutex.synchronize do | |
@thread = Thread.new { loop } | |
@thread.abort_on_exception = true | |
end | |
end |
class BackoffTimer | |
class << self | |
def create(range, stepper, opts = {}) | |
timer = new(intervals(range, stepper), opts[:immediate], opts[:callback] || Proc.new) | |
timer.start unless opts[:start] == false | |
timer | |
end | |
def exponential(range, opts = {}) | |
opts[:callback] ||= Proc.new |
class WaitGroup | |
def initialize(initial_count = 0) | |
@count = initial_count | |
@cond = ConditionVariable.new | |
@mutex = Mutex.new | |
end | |
def add(delta = 1) | |
synchronize do | |
count = @count += 1 |
def format event | |
{ header, payload } = SomeModule.somefn(event) | |
join_results(format_header(header), format_payload(payload)) | |
end | |
def format_header(header) | |
# do stuff | |
.... | |
# and return |
require 'fiber' | |
require 'eventmachine' | |
module Actor | |
class << self | |
def current | |
Mailbox.current | |
end | |
end |