Skip to content

Commit

Permalink
docs: add docs to new observeRevokedCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianIOHK committed Apr 17, 2024
1 parent ead1b6a commit 4a42770
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ class ConnectionManager(
serviceEndpointUrl
) { arrayMessages ->
processMessages(arrayMessages)
// // Process the received messages
// val messagesIds = mutableListOf<String>()
// val messages = mutableListOf<Message>()
// arrayMessages.map { pair ->
// messagesIds.add(pair.first)
// messages.add(pair.second)
// }
// // If there are any messages, mark them as read and store them
// scope.launch {
// if (messagesIds.isNotEmpty()) {
// mediationHandler.registerMessagesAsRead(
// messagesIds.toTypedArray()
// )
// pluto.storeMessages(messages)
// }
// }
}
}
// Fallback mechanism if no WebSocket service endpoint is available
Expand All @@ -109,18 +93,6 @@ class ConnectionManager(
// Continuously await and process new messages
awaitMessages().collect { array ->
processMessages(array)
// val messagesIds = mutableListOf<String>()
// val messages = mutableListOf<Message>()
// array.map { pair ->
// messagesIds.add(pair.first)
// messages.add(pair.second)
// }
// if (messagesIds.isNotEmpty()) {
// mediationHandler.registerMessagesAsRead(
// messagesIds.toTypedArray()
// )
// pluto.storeMessages(messages)
// }
}
// Wait for the specified request interval before fetching new messages
delay(Duration.ofSeconds(requestInterval.toLong()).toMillis())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,10 @@ class PrismAgent {
)
}

/**
* This method provides a channel to listen for credentials that are revoked. As long as there is an
* observer collecting from this flow the updates will keep happening.
*/
fun observeRevokedCredentials(): Flow<List<Credential>> {
return pluto.observeRevokedCredentials()
.map { list ->
Expand Down

0 comments on commit 4a42770

Please sign in to comment.