Skip to content

Semantics of Future<Boolean> for persistence #55

@ajs6f

Description

@ajs6f

If a persist call (that returns Future<Boolean>) is completed unexpectedly (in my example in hand, an InterruptedException which does not indicate failure of persistence, but failure of the thread monitoring persistence, since the actual persistence is happening elsewhere on the network) should true or false result?

IOW, if the backend cannot give us definite information about the completion, what should it report forward?

I don't want to get into Future<Optional<Boolean>> weirdness. But maybe an enum Completion {Success, Failure, Unknown} or the like and return Future<Completion>? Or maybe there's a better way to say the same thing within the Java concurrency APIs…

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions