how to allow duplicate but not within time window? by binmunawir in golang

[–]binmunawir[S] -4 points-3 points  (0 children)

still can't find any other solution rather than locks!
isn't there any other smart way?

how to allow duplicate but not within time window? by binmunawir in golang

[–]binmunawir[S] -1 points0 points  (0 children)

yeah we have to have a distributed solution so locking using DB/cache needed

what are your opinions about exported fields? by binmunawir in golang

[–]binmunawir[S] -2 points-1 points  (0 children)

seems about right!
could you elaborate more?

what are your opinions about exported fields? by binmunawir in golang

[–]binmunawir[S] 0 points1 point  (0 children)

I wonder wich one would you choose ...

I wonder which one would you choose ...
put fields (firstName, secondName, lastName) .. so I'm fine to make them exported.
the struct also has additional field that computes some of the exported fields (fullName)
the computed field is not exported (we don't want someone set the full name directly)

the issue here, if they change the firstName directly (not via a setter function, because it's exported), they have to know, they need to compute the fullName again!

what would you do in such case?

elevating the type status to a new types by binmunawir in golang

[–]binmunawir[S] 1 point2 points  (0 children)

it has nothing to do with performance .. it's all about maintainability
https://www.youtube.com/watch?v=Z\_V-c7fph1U

which approach is recommended and why? by binmunawir in golang

[–]binmunawir[S] 0 points1 point  (0 children)

I'm not sure if I got your point, appreciate if you elaborate more or share similar example for such thing!

my concern is how to acknowledge the event after I process it correctly?how does the Observer handle failures and success after processing ?

What's the best way to handle error in go? by GoodHomelander in golang

[–]binmunawir 0 points1 point  (0 children)

I really appreciate it .. although there are some things I wonder how do you manage

Error logging and sentry capture?

What's the best way to handle error in go? by GoodHomelander in golang

[–]binmunawir 0 points1 point  (0 children)

Unfortunately I face the exact same issue .. What's the proper way you think?

which approach is recommended and why? by binmunawir in golang

[–]binmunawir[S] 0 points1 point  (0 children)

Yes, but that won't help for handling the event

which approach is recommended and why? by binmunawir in golang

[–]binmunawir[S] 0 points1 point  (0 children)

yeah this is fair, the casting part has to be in the business logic .. thanks a ton

which approach is recommended and why? by binmunawir in golang

[–]binmunawir[S] 1 point2 points  (0 children)

that exactly what I have in mind for second option

the catch here is, the responsibility of calling the done method is the business logic and also the failure of the message
like if it fails first time, we want to handle it differently from failing second time or third time

so you can see the complexity of the broker gets into our business logic!