tuweni / org.apache.tuweni.scuttlebutt.lib / FeedService / publish

publish

fun <T : ScuttlebuttMessageContent!> publish(content: T): AsyncResult<FeedMessage!>! (source)

Publishes a message to the instance's own scuttlebutt feed, assuming the client established the connection using keys authorising it to perform this operation.

Parameters

content - T: the message to publish to the feed

- the content published should extend ScuttlebuttMessageContent to ensure the 'type' field is a String

Exceptions

JsonProcessingException - if 'content' could not be marshalled to JSON.

Return
AsyncResult<FeedMessage!>!: the newly published message, asynchronously