Code Monkey home page Code Monkey logo

smf-go's Introduction

smf-go's People

Contributors

crackcomm avatar emaxerrno avatar

Stargazers

Brijesh Sahoo avatar Anthony Zboralski avatar Nam Nguyen avatar Basel Ajarmah avatar Alexander Bosy avatar 望哥 avatar Rob Skillington avatar Chaitanya Phalak avatar  avatar Jeff Carpenter avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

Forkers

crackcomm icodein

smf-go's Issues

Add maintainer

@crackcomm - hey man, with the addition of python from @noahdesu I'd love to give you maintainer access to the smf-go repo so you can maintain this subrepo and we start to build a bigger community.

Thoughts?

wrap in goroutine crashed

crash

package main

import (
        "context"
        "log"
        "time"
        //"strings"

        flatbuffers "github.com/google/flatbuffers/go"

        "github.com/smfrpc/smf-go/example/demo"
        "github.com/smfrpc/smf-go/example/demo_gen"
        "github.com/smfrpc/smf-go/src/smf"
)

//var xreq = strings.Repeat("x", 11)
var xreq = string([]byte{0,3,23,41})

func buildRequest() []byte {
        builder := flatbuffers.NewBuilder(0)
        name := builder.CreateString(xreq)
        demo.RequestStart(builder)
        demo.RequestAddName(builder, name)
        resp := demo.RequestEnd(builder)
        builder.Finish(resp)
        return builder.FinishedBytes()
}

func main() {
        client, err := smf.Dial("tcp", "127.0.0.1:20766")
        if err != nil {
                log.Fatal(err)
        }

        store := demo_gen.NewSmfStorageClient(client)
        //resp, err := store.Get(context.TODO(), buildRequest())
        start := time.Now()
        for i:=0;i<100000;i++ {
                go func() {
                        resp, err := store.Get(context.TODO(), buildRequest())
                        if err != nil {
        //                      log.Fatal(err)
                        }
                        log.Printf("Response: [ name=%q ]", resp.Name())
                }()
        }
        client.Close()

        elapsed := time.Since(start)
        log.Printf("Binomial took %s", elapsed)
        time.Sleep(100*time.Second)

}

Go: flatbuffers API fork

I am still in great ❤️ love with smf certainly the fastest RPC in the west.

I was held back from making a Go implementation mainly because of UX experience and that isn't great with Golangs flatbuffers generated code and implementation.

I need to explore ways to create better user experience for Golang users.

Do you think it is even worth to use native flatbuffers accessors with such overhead?

Maybe in most real-world use cases when request data is accessed more than once it would be probably better to copy the data into the struct. Some cases like byte array could be still stored as flatbuffers table with accessor method.

Last thing I want to ask you is parser and generator is smfc place for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.