cabol / ex_shards

Elixir wrapper for cabol/shards .

Home Page:https://hexdocs.pm/ex_shards/api-reference.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Has this ever been published to hex?

princemaple opened this issue · comments

Hi @cabol

I just searched on hex for this package, exshards, but it doesn't seem to be there?
shards on hex is just the erlang package, isn't it? Or is it both?

Thanks,
Po

Hi @princemaple

You're right, no hex package for exshards has been published yet. Regarding to the current status of the project I'm not sure if it really worth to publish it now, I'd like to work more on it. On other hand, of course you can use shards from Elixir as well, the library works for both. E.g.:

This is the same README example but using shards instead:

> :shards.new :mytab, []
{:mytab,
 {:state, :shards_local, 8, &:shards_local.pick/3, &:shards_local.pick/3}}

> :shards.insert :mytab, [k1: 1, k2: 2, k3: 3]
true

> for k <- [:k1, :k2, :k3] do
  [{_, v}] = :shards.lookup(:mytab, k)
  v
end
[1, 2, 3]

> :shards.delete :mytab, :k3
true
> :shards.lookup :mytab, :k3
[]

> :shards.new :mytab2, [{:n_shards, 5}]
{:mytab2,
 {:state, :shards_local, 5, &:shards_local.pick/3, &:shards_local.pick/3}}

As you can see, the only difference is that you use :shards as module instead of ExShards.

This is other Elixir project that uses shards directly: KVX

Summing up: 1) For now my recomendation is go for shards, while I define if it really is a good idea to have wrapper or not – BTW, any suggestion is welcome :) 2) I'll try to finish some minor fixes and then publish an initial version of exshards – I'll keep the issue open until then.

Thanks !!!

Hi @cabol thank you for your very detailed reply!

Is there any obvious downside of having the wrapper?
What issues need to be fixed?

Thank you!

@princemaple about your questions:

  1. No, there is no any downside to use the wrapper, you can use it if you feel more confortable with it.

  2. Regarding to the issues:

    • I'd like to add some tests
    • As I've done several changes on shards, I'd like to check and be sure everything is OK with exshards.
    • Finally, I'd like to explore possible enhancements.

Thanks !!

Great, Thank you! I'll start with using :shards and switch to ExShards if you decide to release it.

I guess one thing that might be better with ExShards is documentation. Even though all the functions defined are just wrapping the functions in the erlang module, you can probably still put documentation in the wrapper to make it more user friendly :)

It's true, that makes a lot of sense, I'll do that! Thanks !! :)

@princemaple I've pushed a 1st stable release of ex_shards and I published it on hex already! Check HERE. Please try it out and let me know any issue you have.

So I think we can close this issue.

Thanks!!