https://peter.bourgon.org/go-for-industrial-programming/
future := make(chan int, 1)
go func() { future <- process() }()
result := <- future
#![allow(unused)] | |
use std::fmt; | |
#[derive(Copy, Clone)] | |
pub struct Type<'a> { | |
mime_type: &'a str, | |
} | |
impl<'a> Type<'a> { |
https://peter.bourgon.org/go-for-industrial-programming/
future := make(chan int, 1)
go func() { future <- process() }()
result := <- future
package main | |
import ( | |
"fmt" | |
"strings" | |
"time" | |
) | |
func upper(input string) string { | |
fmt.Println("upper " + input) |
Simple, quick performance demo / test comparing JavaScript and WebAssembly. Uses fibonacci (n = 40) with 31 runs.
Convert fib.wat
to wasm
using wat2wasm tool and download as fib.wasm
.
Use Node.js 10.
Run:
node index.js
Microbenchmarks like this should always be taken with a grain of salt; but it's interesting to do a comparison.
Source code for the server implementations
Using:
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
type Cap struct { | |
message string | |
} |
package main | |
import ( | |
"log" | |
"sync" | |
"time" | |
) | |
const tasksPerSecond = 1 |
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.
// 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 |