Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Spencer Goh
@dymaxionuk
the biggest limitation of transactions imo, is of having to chain the parameters from step to step.... so step 1 has 5 params.. of which onky 2 are pertinent for step 2, and diff 2 are useful for step 3 etc... end up passing through in hash, most of the unused params
seems kinda pointless... and once you have the DO notation, the usefulness of step: adapters goes away
Tim are you thinking of deprecating Dry::Transaction one day?
Tim Riley
@timriley
@dymaxionuk No, dry-transaction will remain, it’s useful for many things
How have you found it to be slow?
Viet (Drake) Tran
@tiev
@dymaxionuk with functional objects style, the object interface is simple, you can compose instead of inherit a base class
I use dry-transaction for an importing CSV process and see no slowness
Spencer Goh
@dymaxionuk

Not slow per se, and unlikely issue in real world, but there was a page was linked off the dry-* website, where someone had done some perf tests... and shown that transactions were n factor slower than pure monads.. but then you get all the other benefits... hooks, notifications etc.

Personally not that useful to me anymore for what I wanna do...

a side issue relating to dry-system / Container , when config.auto_register is used, by default the AutoRegistrar will register a block taht creates a new instance.
i'd like to register a single instance of a class - (I have some stateless ext api adapter classes) that are used to call other services - i dontn really want to instantiate on each container resolution
woudl be nice to have a the option to pass a hash to that configuration
```
auto_register = { 'lib/stuff' => :instantiate, 'lib/singlestuff' => :singleton }
Mario Viapiano
@emeve89
Hello everyone, I've been using dry-container & dry-auto_inject to, of curse, avoid to reference dependencies in some classes (as part of the process of applying clean/hexagonal architecture). The thing is that when I use dry-auto_inject, my use cases now depend on the container that lives in a outter layer. What do you think about that? how do you "mix" the use of auto-inject & the guidelines of the clean architecture, for example?
Spencer Goh
@dymaxionuk
or :memoize option I guess is really waht I'm looking to pass through
but the auto register config can't pass that down into the container.register call.
Shawn Anderson
@shawn42
Hi everyone. Thanks for making such a great suite of libraries. I really appreciate all the work and time you've all put in.
Nikita Shilnikov
@flash-gordon
Thanks :heart:
Shawn Anderson
@shawn42
I do have a question the best way to use the List monad over a collection of Try results. The list is built dynamically, then I want to create a List out of the results. When I try to traverse them, it complains about it not being typed. I've tried adding .typed calls, but am not sure what the correct type is. Try did not work. (apologies if this is something simple; I'm pretty new to monads)
Is there a way to use the List monad to collect all my Failure objects? traversing only seems to return the first error. Warning: I'm fairly new to monads.
oh man, gitter is being flaky.. it didn't tell me that last message actually sent...
Hi everyone. Thanks for making such a great suite of libraries. I really appreciate all the work and time you've all put in.
what I'm shooting for is: something like M::List::Validated[M::Success(1), M::Failure("boom 2")].typed(M::Result).traverse => Failure(List<Result>["boom 1", "boom2"])
Philip Arndt
@parndt

Hey folks, we've been testing Zulip as a Gitter replacement for the last few days. So far it feels really great and we'd like more people to sign up and check it out. We did not decide yet if we want to switch but it's likely that we will, because of this please sign up and let's chat there whether you like it or not.

You can sign up right here: https://dry-rb.zulipchat.com/register/

If you haven't heard about Zulip, it's an OSS communication platform. Something between a chat and email, with a unique communication model based on streams and topics. The company behind it was acquired by Dropbox, but they open sourced the project back in 2015. Its development is very active and it looks promising in general.

Check out Why Zulip here: https://zulipchat.com/why-zulip/

you could try Zulip @shawn42 ^

Shawn Anderson
@shawn42
Thanks @parndt I'll check it out
Philip Arndt
@parndt
gitter's being super janky for me too
Piotr Solnica
@solnic
yes, especially that Gitter is acting WEIRD lately
Nikita Shilnikov
@flash-gordon
Yeah, that’d be the best way :)
Piotr Solnica
@solnic
like messages from @shawn42 are disappearing for me, then re-appearing but in a different order lol
Shawn Anderson
@shawn42
so zulip is kind of a google wave rebirth? ;)
also, now that you are all here.. any ideas on the best way to collect my failures using a list monad? or is that not the correct usage?
Jeff Dickey
@jdickey
That's really odd, @solnic . I live in Gitter most of the day (20+ open channels, more than half of those active on a given day) and I've never seen that happen. Not disbelieving; just wondering if it's a geographic/network backbone thing somehow
Piotr Solnica
@solnic
@jdickey I had a lot of issues like that but today is exceptionally bad
Jeff Dickey
@jdickey
That is weird. My gripe is that development seems to have basically stopped; they had a Version 2 that had some much-needed new features and bug fixes out for a while a year and a half ago or so, and then they yanked it and everybody's on 1.177 from 2016. If there's a better-maintained/more solid app out there, I'm open to the thought
Piotr Solnica
@solnic
@jdickey we're switching to Zulip
Jeff Dickey
@jdickey
Understoon
Piotr Solnica
@solnic
we also tried Slack, Rocket, Discord and Spectrum
eventually it turned out Zulip is the best option
Piotr Solnica
@solnic

@/all hey, after 2 weeks of testing we decided to switch to Zulip and we are saying "good bye" to Gitter. From April 1st (no kidding) we'll be hanging out in Zulip and stop paying attention to this Gitter chat. You can join our Zulip organization here: https://dry-rb.zulipchat.com/register/

ps. rom-rb gitter chat will move too

Philip Arndt
@parndt
:tada:
Brice Sanchez
@bricesanchez
:tada:
Orban Botond
@orbanbotond

Hi Guys,

How can I use succesfully the inheritance in dry-rb transactions?

Here is the code which shows that it just doens’t work:

require 'spec_helper'

module CRUD
  class Update
    include Dry::Transaction

    step :validate
    step :persist


    def validate(input)
      Success(input.to_s + model_class.to_s)
    end

    def persist(input)
      Success(input.to_s + model_class.to_s)
    end
  end

  class ORMModel1
  end

  class Update1 < Update
    def model_class
      ORMModel1
    end
  end
end

describe 'ParamOverride' do
  context 'update1' do
    subject { CRUD::Update1.new.call params }
    let(:params) { {a:1,b:2} }

    context 'negative cases' do
      specify 'inheritance just does not work' do
        expect(subject).to be_success
        expect(subject.value!).to_not eq('{}ORMModel1')
      end
    end
  end
end
Viet (Drake) Tran
@tiev
What is the output? Btw, can you move to zulipchat? This gitter is abandoned
Orban Botond
@orbanbotond
@tiev I expected the output to be '{}ORMModel1’
Viet (Drake) Tran
@tiev
And I guess the actual output is '{:a=>1, :b=>2}ORMModel1ORMModel1'
Orban Botond
@orbanbotond
@tiev no, the actual output is {:a=>1, :b=>2}
Lairan
@alex-lairan

@/all hey, after 2 weeks of testing we decided to switch to Zulip and we are saying "good bye" to Gitter. From April 1st (no kidding) we'll be hanging out in Zulip and stop paying attention to this Gitter chat. You can join our Zulip organization here: https://dry-rb.zulipchat.com/register/

ps. rom-rb gitter chat will move too

Sergey Kukunin
@Kukunin
Hi guys. I want to serialize/deserialize my dry-struct to JSON. Is there a way to derive a new dry-struct which can build an original from JSON? I expect it to convert all types to their JSON equivalents
I expect it to work recursively
Lairan
@alex-lairan
Please, read my last message :)
Martín Fernández
@bilby91
Hello! I’m looking into dry-validations 1.X and I was wondering if there is any way to compose multiple contracts, basically delegate the validation of a given property from within a contract to another contract.