Show / Hide Table of Contents

Class DistributedQuery<T>

A query that is sent to multiple peers.

Inheritance
Object
DistributedQuery<T>
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk.Routing
Assembly: PeerTalk.dll
Syntax
public class DistributedQuery<T>
    where T : class
Type Parameters
Name Description
T

The type of answer returned by a peer.

Properties

| Improve this Doc View Source

Answers

The received answers for the query.

Declaration
public IEnumerable<T> Answers { get; }
Property Value
Type Description
IEnumerable<T>
| Improve this Doc View Source

AnswersNeeded

The number of answers needed.

Declaration
public int AnswersNeeded { get; set; }
Property Value
Type Description
Int32
Remarks

When the numbers Answers reaches this limit the RunAsync(CancellationToken) will stop.

| Improve this Doc View Source

ConcurrencyLevel

The maximum number of concurrent peer queries to perform for one distributed query.

Declaration
public int ConcurrencyLevel { get; set; }
Property Value
Type Description
Int32

The default is 16.

Remarks

The number of peers that are asked for the answer.

| Improve this Doc View Source

Dht

The distributed hash table.

Declaration
public Dht1 Dht { get; set; }
Property Value
Type Description
Dht1
| Improve this Doc View Source

Id

The unique identifier of the query.

Declaration
public int Id { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

QueryKey

The key to find.

Declaration
public MultiHash QueryKey { get; set; }
Property Value
Type Description
MultiHash
| Improve this Doc View Source

QueryType

The type of query to perform.

Declaration
public MessageType QueryType { get; set; }
Property Value
Type Description
MessageType

Methods

| Improve this Doc View Source

AddAnswer(T)

Add a answer to the query.

Declaration
public void AddAnswer(T answer)
Parameters
Type Name Description
T answer

An answer.

| Improve this Doc View Source

RunAsync(CancellationToken)

Starts the distributed query.

Declaration
public Task RunAsync(CancellationToken cancel)
Parameters
Type Name Description
CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task

A task that represents the asynchronous operation.

Events

| Improve this Doc View Source

AnswerObtained

Raised when an answer is obtained.

Declaration
public event EventHandler<T> AnswerObtained
Event Type
Type Description
EventHandler<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX