``` val post = it.writeTransactionAsyn...
# arrow
a
Copy code
val post = it.writeTransactionAsync {
                it.runAsync(query, parameters("postId", postId, "userId", userId, "timestamp", System.currentTimeMillis()))
                        .thenCompose(StatementResultCursor::peekAsync)
                        .thenApply { record ->
                            Option.fromNullable(record).map { Tuple2(it["post"]["id"].asString(), it["poster"]["id"].asString()) }
                        }
            }.await()
            
            val likesCount = post.map {
                session.readTransactionAsync { tx ->
                    tx.runAsync(notificationQuery, parameters("postId", it.a))
                            .thenCompose(StatementResultCursor::peekAsync)
                            .thenApply { record ->
                                record["likesCount"].asInt()
                            }
                }.await()
                
            }
Something like this