We can turn the database service into a concurrent service:
declare P={MakeServer DB}
proc {DBGet Key Val} {Send P get(Key Val)} end
but now we have no way of writing
DBCondGet
because if an
exception is raised, this happens on the server thread processing the
request and not on the client thread issuing this request
- we need some way of catching the exception on the server, packaging
it, and handing it over to the client
- when a value is expected by the client to be computed by the
server, we can use a failed future to indicate an error
during this computation