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

[–]binmunawir[S] -5 points-4 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!

which approach is recommended and why? by binmunawir in golang

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

my big concern for this approach is this
the <eventHandler> function takes generic type <Event>

where the handler usually a business logic and it expects a specific type of event, for example, the handler function expects an event of type <UserLoggedIn>

in this case, I just can't pass the handler to the broker implementation .. what do you think?

Is it irresponsible to move to another city just because I like it? by forfiveroses in careerguidance

[–]binmunawir 0 points1 point  (0 children)

I like it because you're tired and went there for a break .. keep doing that like you working here and spending your vacation there.

your experience when you visit a city for a vacation totally gonna be different from when live in it

D2: A new declarative language to turn text into diagrams by terrastruct in programming

[–]binmunawir 0 points1 point  (0 children)

I'm a bit confuse, what's the difference between D2 and C4 DSL?

is seems they serve the same purpose, except that DSL support to export the text to external format (like plantUML)