it takes 5 seconds to finish but the client should receive a success message instantly right?
by default every request handled by net/http is executed in a separate goroutine, so by default you’re doing just that
it depends on your business logic. If your business requirements say you need a real confirmation of things being done - then you can’t just return OK if the transaction isn’t commited yet
No. They should not receive a success message when in reality the insert operation could possibly fail.
Обсуждают сегодня