Git Product home page Git Product logo

yggdrasil's People

Contributors

alexdesousa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yggdrasil's Issues

Example for RabbitMQ or is it broken?

config/dev.exs

config :yggdrasil,
  rabbitmq: [host: "127.0.0.1",
    port: 5672,
    username: "dwalin",
    password: "dwalin",
    virtual_host: "/"]

iex -S mix

iex(1)> Application.ensure_started(:yggdrasil)
:ok
iex(2)> Application.ensure_started(:dwalin)
:ok
channel = %Yggdrasil.Channel{channel: "example", decoder: Yggdrasil.Decoder.Default.RabbitMQ}
Yggdrasil.subscribe(channel)
[debug] Started publisher for %Yggdrasil.Channel{channel: "example", decoder: Yggdrasil.Decoder.Default.RabbitMQ}.
** (exit) exited in: GenServer.call(Yggdrasil.Broker, {:subscribe, %Yggdrasil.Channel{channel: "example", decoder: Yggdrasil.Decoder.Default.RabbitMQ}, #PID<0.264.0>}, 5000)
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, Yggdrasil.Adapter.RabbitMQ, {:function_clause, [{Yggdrasil.Adapter.RabbitMQ, :init, [%Yggdrasil.Adapter{channel: "example", publisher: {:via, ExReg, {Yggdrasil.Publisher, "example", Yggdrasil.Decoder.Default.RabbitMQ}}}], [file: 'lib/yggdrasil/adapter/rabbitmq.ex', line: 28]}, {Connection, :init_it, 6, [file: 'lib/connection.ex', line: 424]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}}
            (yggdrasil) lib/yggdrasil/publisher/generator.ex:40: Yggdrasil.Publisher.Generator.start_publisher/2
            (yggdrasil) lib/yggdrasil/broker.ex:198: Yggdrasil.Broker.do_subscribe/3
            (yggdrasil) lib/yggdrasil/broker.ex:303: Yggdrasil.Broker.handle_call/3
            (stdlib) gen_server.erl:615: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:647: :gen_server.handle_msg/5
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
[error] GenServer Yggdrasil.Broker terminating
** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, Yggdrasil.Adapter.RabbitMQ, {:function_clause, [{Yggdrasil.Adapter.RabbitMQ, :init, [%Yggdrasil.Adapter{channel: "example", publisher: {:via, ExReg, {Yggdrasil.Publisher, "example", Yggdrasil.Decoder.Default.RabbitMQ}}}], [file: 'lib/yggdrasil/adapter/rabbitmq.ex', line: 28]}, {Connection, :init_it, 6, [file: 'lib/connection.ex', line: 424]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}}
    (yggdrasil) lib/yggdrasil/publisher/generator.ex:40: Yggdrasil.Publisher.Generator.start_publisher/2
    (yggdrasil) lib/yggdrasil/broker.ex:198: Yggdrasil.Broker.do_subscribe/3
    (yggdrasil) lib/yggdrasil/broker.ex:303: Yggdrasil.Broker.handle_call/3
    (stdlib) gen_server.erl:615: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:647: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:subscribe, %Yggdrasil.Channel{channel: "example", decoder: Yggdrasil.Decoder.Default.RabbitMQ}, #PID<0.264.0>}
State: %Yggdrasil.Broker{generator: Yggdrasil.Publisher.Generator, monitors: 94246, subscribers: 98343}
       (elixir) lib/gen_server.ex:604: GenServer.call/3
    (yggdrasil) lib/yggdrasil/backend.ex:55: Yggdrasil.Backend.join/2

Yggdrasil v6.0 and Yggdrasil_postgres v5.0 dependencies problem

I use {:phoenix, "~> 1.6.6"} with project[:elixir] = 1.13 and {:yggdrasil, "~> 6.0"} and config :yggdrasil, postgres: [hostname: "localhost"]

I tested the "pg_notify" example:

iex> Yggdrasil.subscribe(name: "new_books", adapter: :postgres, transformer: :json)
{:error, "Yggdrasil postgres not registered in any node"}

If I declare {yggdrasil, "~> 5.0"}, then I have a dependency problem. The command mix deps.get returns:

Failed to use "phoenix_pubsub" (version 2.0.0) because
phoenix (version 1.6.6) requires ~> 2.0
yggdrasil (versions 5.0.1 and 5.0.2) requires ~> 1.1

I tested that the trigger worked with Postgrex.Notification using this setup:

# when I notify in a psql session:
yggdrasil_pg_notify=# NOTIFY "new books", '{"id": 1, "title": "one"}';

# the iex responds with:
iex(2)> [info] [id: 1, title: "one"]

Examples not working

If I try to use the first example from the README:

Yggdrasil.Feed.subscribe Yggdrasil.Feed,
  Yggdrasil.Broker.Redis,
  "trees",
  &(IO.puts "#{inspect &1}")

I get this error:

** (exit) exited in: GenServer.call(Yggdrasil.Feed, {:subscribe, Yggdrasil.Broker.Redis, "trees"}, 5000)
    ** (EXIT) no process
    (elixir) lib/gen_server.ex:596: GenServer.call/3
             lib/yggdrasil/feed.ex:32: Yggdrasil.Feed.subscribe/4

Can you please add some more information to the README, how to use this library? The examples look quite useful, but I can't get them working.

Installed Elxir:

$ elixir --version
Erlang/OTP 19 [erts-8.0.2] [source-9503fff] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.3.2

Awesome project!

Hi!
Very very very awesome project!
One missing piece of functionality(that i can open a PR for assuming it makes sense) - How can i send rabbitmq options(the 5th param to AMQP.Basic.publish) - that can include headers etc..
Maybe a general options param to publish can be added that each adapter can do whatever he wants with?
Maybe the message encoder can do more and extract headers?
What do you think

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.