Skip to content

Instantly share code, notes, and snippets.

View weidonglian's full-sized avatar

Weidong Lian weidonglian

View GitHub Profile
@weidonglian
weidonglian / greeter_async_server.cc
Created April 7, 2018 19:02 — forked from yang-g/greeter_async_server.cc
grpc async server toy example
// Class encompasing the state and logic needed to serve a request.
class CallDataBase {
public:
// Take in the "service" instance (in this case representing an asynchronous
// server) and the completion queue "cq" used for asynchronous communication
// with the gRPC runtime.
CallDataBase(Greeter::AsyncService* service, ServerCompletionQueue* cq)
: service_(service), cq_(cq), status_(PROCESS) {}
virtual ~CallDataBase() {}
@weidonglian
weidonglian / main.go
Created November 12, 2017 22:38 — forked from nmerouze/main.go
JSON-API with Go and MongoDB: Final Part
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"