Skip to content

Instantly share code, notes, and snippets.

View bojand's full-sized avatar
💭
I may be slow to respond.

Bojan bojand

💭
I may be slow to respond.
View GitHub Profile
@bojand
bojand / driver-service-server.go
Last active August 8, 2017 18:05
Hot R.O.D. driver service fixed
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@bojand
bojand / index.md
Last active July 15, 2024 02:51
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@bojand
bojand / list.md
Last active October 6, 2017 17:06
Chart libraries

List

  • d3
  • Flot
  • vis.js
  • Highcharts
  • Google charts
  • Raphael
  • Processing.js
  • Chart.js
  • Chartist.js
@bojand
bojand / async.md
Created November 17, 2017 18:49
async + await

asynctest.js

function foo() {
  return 'bar'
}

async function afoo() {
  return 'bar'
}
@bojand
bojand / mytype.go
Last active May 16, 2018 23:53
Custom JSON Marshal
package main
import (
"encoding/json"
"fmt"
"time"
)
const layout = "2006-01-02"
@bojand
bojand / embedded_receiver.go
Last active August 24, 2018 17:36
Go structs
package main
import (
"fmt"
)
type E struct{}
func (e *E) foo() {
fmt.Println("E.foo()")
@bojand
bojand / buffer_iface.go
Last active April 7, 2019 17:18
Go interfaces
package main
import (
"bytes"
"fmt"
"io"
"reflect"
)
func do(w io.Writer) {
@bojand
bojand / types.go
Created March 16, 2018 13:22
Go type conversions
package main
import (
"fmt"
"time"
)
const layout = "2006-01-02"
type MyBool bool
@bojand
bojand / throttle.go
Created March 25, 2018 01:03
goroutine throttling
package main
import (
"log"
"sync"
"time"
)
const tasksPerSecond = 1
@bojand
bojand / override.go
Created April 4, 2018 12:05
Method override in Go
package main
import (
"fmt"
"strings"
)
type Cap struct {
message string
}