Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Nikita Shilnikov
@flash-gordon
ah, nvm, I should ping you, just forgot completely
Piotr Solnica
@solnic
@flash-gordon I’d encourage you to push this kind of fixes directly to master
ie I do that, so I don’t see any reason why other devs shouldn't be doing that too
(devs with commit access, of course)
Nikita Shilnikov
@flash-gordon
kk
Piotr Solnica
@solnic
I tend to review changes prior releases anyway, and we can always fix/improve things before a release
Tim Riley
@timriley
@apotonick how’s this look as an auto-inject strategy for Trailblazer 2 operations? https://gist.github.com/timriley/d314a58da9784912159006e208ba8ea9
I just focused on the class method version of .call - I’m not sure what behaviour you want from instances
Nick Sutterer
@apotonick
@timriley it looks awesome
:) now let's see if it works haha
thanks @timriley <3
Tim Riley
@timriley
np, lemme know how it goes, @apotonick!
Nick Sutterer
@apotonick
@timriley working a bit more with matcher, i think you're right about what you said earlier
Piotr Solnica
@solnic
Screen Shot 2016-11-03 at 17.09.00.png
@wafcio @jodosha we won RubyWeekly today ^^ :D
Ivo Benedito
@ivobenedito
hehe cool stuff there
Oskar Szrajer
@gotar
nice ;]
Nick Sutterer
@apotonick
great, get out the word!
Nick Sutterer
@apotonick
cool post, @solnic
Uros Jurglic
@jurglic
Hi guys! I'm new to dry-transaction gem, and I need an advice
Screen Shot 2016-11-04 at 13.22.26.png
^^ We have a transaction defined like this
Now the business requirement changed so that first three operations need to be run always - regardless of the result of the previous operation.
What would be the right way to approach in dry transaction?
Piotr Solnica
@solnic
@jurglic then it’s no longer a transaction :)
Uros Jurglic
@jurglic
Yeah, that crossed my mind too!
@solnic But if we forget that one for a minute... would something like that make more sense?
Screen Shot 2016-11-04 at 13.44.04.png
Piotr Solnica
@solnic
@jurglic it does
Uros Jurglic
@jurglic
Can the first three operations still use Either response? Or will it fail if one of them returns Left?
Nikita Shilnikov
@flash-gordon
@jurglic
Uros Jurglic
@jurglic
Is that so even if step is defined as map :qc_silence?
Thanks
Nikita Shilnikov
@flash-gordon
the only place where step adapter is used is here https://github.com/dry-rb/dry-transaction/blob/master/lib/dry/transaction/step.rb#L36 so your step have to return a Right instance always
Uros Jurglic
@jurglic
Sorry it's a bit confusing to me. So if I use map :qc_silence, the QcSilence should never return Left?
Nikita Shilnikov
@flash-gordon
no worries, well, map always returns Right so it should work just fine for you :) BUT there is a caveat
if you return Left/Right from QcSilence, map will wrap it once again
so you'll get Right(Right(...)) or Right(Left(...))
Uros Jurglic
@jurglic
Aha, I see.
Piotr Solnica
@solnic
according to docs, map always returns Right
Uros Jurglic
@jurglic
So you think my approach is somewhat acceptable? :D
@solnic Thanks Piotr yeah I saw that one, that's why I was confused before.
Piotr Solnica
@solnic
feels like an overhead though, if it always returns Right then maybe it’d be better to just pass plain values
Uros Jurglic
@jurglic
So the first 3 operations, - as implemented now - can return Left or Right. However they are independent. And now new requirement came they should run always no matter if any of them failed in a previous step.
So I'm trying to figure out what's the approach best aligned with dry-transaction.
Tim Riley
@timriley
Right now, it feels like it's be better just to run those three things in a custom class
@apotonick's pipetree stuff in trailblazer 2 makes me want to enrich some of the functionality of dry-transaction, but in a little while
Nick Sutterer
@apotonick
@timriley i was evaluating it
and decided to use my own pipetree stuff that is approved to work in representable, and is super fast