Created
July 21, 2019 08:17
-
-
Save ghostdogpr/5a380c8ccca76cbf7c2ac4cfe4f83d50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send(client: SqsAsyncClient, queueUrl: String, msg: String): Task[Unit] = | |
IO.effectAsync[Any, Throwable, Unit] { cb => | |
client | |
.sendMessage(SendMessageRequest.builder.queueUrl(queueUrl).messageBody(msg).build) | |
.handle[Unit]((_, err) => { | |
err match { | |
case null => cb(IO.unit) | |
case ex => cb(IO.fail(ex)) | |
} | |
}) | |
() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment