Code Monkey home page Code Monkey logo

Comments (11)

chrislusf avatar chrislusf commented on August 16, 2024

from gleam.

 avatar commented on August 16, 2024

Okay, thank you! I appreciate the work and the quick response.

from gleam.

chrislusf avatar chrislusf commented on August 16, 2024

Please let me know the use case you have in mind.

from gleam.

 avatar commented on August 16, 2024

No problem. Basically what I want to do is something like this:

    flow.New().Source(
         // stream of protobuf messages
    ).Map(
         // demarshal protobuf
    ).Filter(
        // ...
    ).Map(
        // protobuf to json
    ).Map(
        // store into redis 
    ).Run()

AFAIK, to do the above in gleam I'd need some external programs or I'd need to write the logic in Lua. Both of these options create additional dependencies (e.g. a redis client library for lua or having to ship these additional binaries).

from gleam.

chrislusf avatar chrislusf commented on August 16, 2024

gleam can automatically ship the binaries to the remote agents for each program, same as glow. This piece of function is not turned on at this moment, but should be fairly easy to do.

from gleam.

 avatar commented on August 16, 2024

Do you mean it'd be easy to allow "mappers" to be written in go again, and that you'd just have to ship the binary from the driver like in glow? That'd be awesome. Glow handles my use case well right now but I would like to eventually upgrade to Gleam to take advantage of all the improvements.

Anyhow, thanks for the consideration/time.

from gleam.

chrislusf avatar chrislusf commented on August 16, 2024

I added an example to use Go code. It is not super nice since it is not that straight forward, but it can get the job done to run mapper in pure Go code.

See https://github.com/chrislusf/gleam/tree/master/examples/word_count_in_go

I am going to add more documentation tomorrow.

from gleam.

 avatar commented on August 16, 2024

Awesome! Nice that you still have a way to distribute go code. As you say, it looks a bit cumbersome at least relative to doing the same in Glow, but it does handle my use case. I'm currently prototyping a project using Glow, I'll try to adapt it to Gleam and report back.

from gleam.

chrislusf avatar chrislusf commented on August 16, 2024

documentation is here https://github.com/chrislusf/gleam/wiki/Write-Mapper-Reducer-in-Go

from gleam.

chrislusf avatar chrislusf commented on August 16, 2024

I changed the implementation overnight. Please check example and documentation again. Now it is one single binary. Just need to register the mapper or reducer at the beginning of the main program.

from gleam.

 avatar commented on August 16, 2024

That looks a lot more convenient! I'll try to give it a spin this week.

from gleam.

Related Issues (20)

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.