Giter VIP home page Giter VIP logo

Comments (7)

davidsantoso avatar davidsantoso commented on July 21, 2024 3

I can’t believe I typed all that on my phone...

well now I feel like we should do it just based on that effort! 😸

from kaffe.

scrogson avatar scrogson commented on July 21, 2024 1

Another thing that would be really nice is if the consumer and producer were behaviours similar to GenServer.

defmodule MyApp.Consumer do
  use Kaffe.Consumer

  def start_link(config, opts \\ []) do
    Kaffe.Consumer.start_link(__MODULE__, config, opts)
  end

  def init(config) do
    {:ok, config}
  end

  def handle_messages(messages, state) do
    ...
  end
end

I can’t believe I typed all that on my phone... πŸ˜€

Then you could start your own module in your supervision tree.

from kaffe.

keathley avatar keathley commented on July 21, 2024 1

@davidsantoso No, I just happened to use that one as an example.

from kaffe.

davidsantoso avatar davidsantoso commented on July 21, 2024

πŸ‘ thanks for all the suggestions. Going to try and carve out some time this week and next to groom the project a bit and see what we can refactor.

from kaffe.

davidsantoso avatar davidsantoso commented on July 21, 2024

@keathley based on your code snippet, curious if y'all use/prefer single message consumers more than the Kaffe.GroupMember setup to do batch message processing?

from kaffe.

fatcatt316 avatar fatcatt316 commented on July 21, 2024

Closing due to above PR

from kaffe.

lud avatar lud commented on July 21, 2024

Hi,

It seems that this change did not make it to the current master of Kaffe. Currently there is no way to set configuration at runtime when starting the supervision tree, everything must be known up front.

For example, topics: You must list your topics in your configuration, but also somehow in you application code because you may want to match on the topic for logic. There is no more a single source of truth for the topic list.

You could say that you would pull your configuration in your code, using the config as a single source of truth. But then either you cannot do it at compile time, like @my_topics Application.fetch_env(:my_app, MyConsumer)[:topics] or you cannot use runtime.exs config because those values are not available at compile time.

from kaffe.

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.