AsyncThreadApi
Asynchronous wrapper over thread API.
Methods
AsyncThreadApi
Creates async thread API over real PrivMX connection.
Params
connection
Connection
Connection used.
AsyncThreadApi
Wraps existing thread api into async thread api. This constructor is meant to be used in advanced scenarios like object mocking and testing.
Params
threadApi
IThreadApi
Existing thread API.
connectionId
long
ID of user connection.
eventDispatcher
IEventDispatcher
Event dispatcher used as event source.
DisposeAsync
Disposes async thread API with all related resources.
Returns
ValueTask
·
CreateThreadAsync
Creates new Thread in given Context.
Params
contextId
string
ID of the Context to create the Thread in.
users
List<UserWithPubKey>
Array of UserWithPubKey which indicates who will have access to the created Thread.
managers
List<UserWithPubKey>
Array of UserWithPubKey which indicates who will have access (and management rights) to the created Thread.
publicMeta
byte[]
Public (unencrypted) meta data.
privateMeta
byte[]
Private (encrypted) meta data.
policies
ContainerPolicy?
(optional) Thread policy.
token
CancellationToken
Cancellation token.
Returns
ValueTask<string>
·
ID of the created Thread.
UpdateThreadAsync
Updates an existing Thread.
Params
threadId
string
ID of the Thread to update.
users
List<UserWithPubKey>
Array of UserWithPubKey structs which indicates who will have access to the created Thread.
managers
List<UserWithPubKey>
Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread.
publicMeta
byte[]
Public (unencrypted) meta data.
privateMeta
byte[]
Private (encrypted) meta data.
version
long
Current version of the updated Thread.
force
bool
Force update (without checking version).
forceGenerateNewKey
bool
Force to regenerate a key for the Thread.
policies
ContainerPolicy?
(optional) Thread policy.
token
CancellationToken
Cancellation token.
Returns
ValueTask
·
DeleteThreadAsync
Deletes a Thread by given Thread ID.
Params
threadId
string
ID of the Thread to delete.
token
CancellationToken
Cancellation token.
Returns
ValueTask
·
GetThreadAsync
Gets a Thread by given Thread ID.
Params
threadId
string
ID of Thread to get.
token
CancellationToken
Cancellation token
Returns
ValueTask<Thread>
·
Information about the Thread.
ListThreadsAsync
Gets a list of Threads in given Context.
Params
contextId
string
ID of the Context to get the Threads from.
pagingQuery
PagingQuery
List query parameters.
token
CancellationToken
Cancellation token.
Returns
ValueTask<PagingList<Thread>>
·
List of Threads.
GetMessageAsync
Gets a message by given message ID.
Params
messageId
string
ID of the message to get.
token
CancellationToken
Cancellation token.
Returns
ValueTask<Message>
·
Message.
ListMessagesAsync
Gets a list of messages from a Thread.
Params
threadId
string
ID of the Thread to list messages from.
pagingQuery
PagingQuery
List query parameters.
token
CancellationToken
Cancellation token.
Returns
ValueTask<PagingList<Message>>
·
List of messages.
SendMessageAsync
Sends a message in a Thread.
Params
threadId
string
ID of the Thread to send message to.
publicMeta
byte[]
Public message metadata.
privateMeta
byte[]
Private message metadata.
data
byte[]
Content of the message.
token
CancellationToken
Cancellation token.
Returns
ValueTask<string>
·
ID of the new message.
UpdateMessageAsync
Updates a message in a Thread.
Params
messageId
string
ID of the message to update.
publicMeta
byte[]
Public message metadata.
privateMeta
byte[]
Private message metadata.
data
byte[]
Content of the message.
token
CancellationToken
Cancellation token.
Returns
ValueTask
·
DeleteMessageAsync
Deletes a message by given message ID.
Params
messageId
string
ID of the message to delete.
token
CancellationToken
Cancellation token.
Returns
ValueTask
·
GetThreadEvents
Stream of threads related events.
Returns
IObservable<ThreadEvent>
·
Observable stream of events.
GetThreadMessageEvents
Stream of events related to a particular thread.
Params
threadId
string
ID of the thread.
Returns
IObservable<ThreadMessageEvent>
·
Observable stream of events.
Dispose
Dispose async thread API with all related resources.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.