pdincau/gcm-erlang — pull request #5 by StephanDollberg (2014-06-30 06:56:41+00:00)
Title: sync_push now returns a list of success/error tuples

As discussed, this is my proposal on how `sync_push` can return what would in `push` be passed to the error callback .

To differentiate between `call` and `cast` I simply pass `undefined` for the error callback in the `call`. The differentiation happens in `handle_push_result` where in the `call` case we do a `lists:map` over the result data and in the `cast` case a `lists:foreach`. To make `parse_results` work with both cases, we pass an identity function as a callback in the `call` case which then works nicely together with the `lists:map`.

Let me know what you think about it and whether any further tests are needed.