Closed siddontang closed 7 years ago
I don't think this comment:
// In our case, the transfer may return fail because of some reasons, but the balance
// is already transfered, so for next read, we will read the corrent data.
makes sense. For event 2, how could ok == false
but the amount is transferred anyways? This isn't a valid step even in the single-threaded model.
@anishathalye
It can be, for a MySQL execution, like update accounts set balance = balance + 1 where id = 0
, after we send this query to the MySQL, and the MySQL executes it, but at this time, the connection is broken with timeout, so we will get an error in the client, but the MySQL can still execute the query successfully.
Maybe here I must add a timeout field in the response, but if the timeout is true, what do I return?
Ah, I see. Yeah, I think the right way to handle this is to add a timeout field in the response, and add the event as executing sometime between invocation time and infinity (because you can't tell when in the future a timed out operation will appear to execute).
You can see how the "unknown" case is handled here: https://github.com/anishathalye/porcupine/blob/master/porcupine_test.go#L96
Thanks @anishathalye
It works now, I will add more tests later.
Hi @anishathalye
I want to use porcupine in our bank transfer case. Our case has two operations:
For simplicity, let's assume we only have two accounts 0 and 1. And I try to use porcupine like this:
Sadly, the check fails, but I have no idea how to fix this. Can you help me figure it out why the check can't work? Thank you.