Skip to content

Releases: sociomantic-tsunami/dhtproto

v14.2.1

15 May 09:16
Compare
Choose a tag to compare

v14.2.0 auto-converted to D2

v14.2.0

02 May 10:21
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/dhtproto/milestone/20?closed=1

Inherited changes from v13.4.0

Features

New handshake helper with built-in task support

dhtproto.client.legacy.internal.helper.Handshake

The new DhtHandshake class wraps the existing RetryHandshake with
easy support for a task-based workflow. This should make it easy for
applications to support a partial handshake, e.g.:

auto retry_delay_seconds = 3;
auto handshake = new DhtHandshake(dht_client, retry_delay_seconds);

// block on at least one node connecting
theScheduler.await(handshake.oneNodeConnected());
Stdout.formatln("At least one node is now connected!");

// wait until either all nodes have connected, or 60 seconds
// have passed, whichever comes sooner (N.B. `awaitOrTimeout`
// is only available for more recent ocean releases)
auto timeout_microsec = 60_000_000;

auto handshake_timed_out =   // true if timeout is reached
    theScheduler.awaitOrTimeout(
        handshake.allNodesConnected(),
        timeout_microsec);

if (handshake_timed_out)
{
    Stdout.formatln(
        "DHT handshake did not succeed within {} seconds!",
        timeout_microsec / 1_000_000);
}
else
{
    Stdout.formatln(
        "DHT handshake reached all nodes before timeout!");
}

// if we timed out, the `DhtHandshake` instance will still
// keep working in the background to connect to the missing
// DHT nodes, so all nodes should be reached eventually

RetryHandshake now has built-in logging

dhtproto.client.legacy.internal.helper.RetryHandshake

The helper logs the following events:

  • Each time it starts a handshake. (info)
  • When the handshake succeeds for a node. (info)
  • When the handshake succeeds for all nodes. (info)
  • When the handshake finished but did not succeed for all nodes and will be
    retried. (info)
  • Whenever the handshake notifier is called. (trace)

Applications that already use this helper may have implemented their own logging
behaviour in the handshake callbacks. It is recommended that this logging is
removed. You should be able to rely on the standard logging output of
RetryHandshake now.

v13.4.0 auto-converted to D2

v13.4.0

02 May 10:21
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/dhtproto/milestone/16?closed=1

Features

New handshake helper with built-in task support

dhtproto.client.legacy.internal.helper.Handshake

The new DhtHandshake class wraps the existing RetryHandshake with
easy support for a task-based workflow. This should make it easy for
applications to support a partial handshake, e.g.:

auto retry_delay_seconds = 3;
auto handshake = new DhtHandshake(dht_client, retry_delay_seconds);

// block on at least one node connecting
theScheduler.await(handshake.oneNodeConnected());
Stdout.formatln("At least one node is now connected!");

// wait until either all nodes have connected, or 60 seconds
// have passed, whichever comes sooner (N.B. `awaitOrTimeout`
// is only available for more recent ocean releases)
auto timeout_microsec = 60_000_000;

auto handshake_timed_out =   // true if timeout is reached
    theScheduler.awaitOrTimeout(
        handshake.allNodesConnected(),
        timeout_microsec);

if (handshake_timed_out)
{
    Stdout.formatln(
        "DHT handshake did not succeed within {} seconds!",
        timeout_microsec / 1_000_000);
}
else
{
    Stdout.formatln(
        "DHT handshake reached all nodes before timeout!");
}

// if we timed out, the `DhtHandshake` instance will still
// keep working in the background to connect to the missing
// DHT nodes, so all nodes should be reached eventually

RetryHandshake now has built-in logging

dhtproto.client.legacy.internal.helper.RetryHandshake

The helper logs the following events:

  • Each time it starts a handshake. (info)
  • When the handshake succeeds for a node. (info)
  • When the handshake succeeds for all nodes. (info)
  • When the handshake finished but did not succeed for all nodes and will be
    retried. (info)
  • Whenever the handshake notifier is called. (trace)

Applications that already use this helper may have implemented their own logging
behaviour in the handshake callbacks. It is recommended that this logging is
removed. You should be able to rely on the standard logging output of
RetryHandshake now.

v14.1.1 auto-converted to D2

v14.1.1

19 Mar 14:26
Compare
Choose a tag to compare

v14.1.0

19 Mar 13:33
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/dhtproto/milestone/13

Inherited changes from v13.3.0

Features

New channel mirror helper with improved handling of connection errors

dhtproto.client.legacy.internal.helper.Mirror

The new channel mirror implementation deliberately has the same API as the old
one, allowing it to be used as a drop-in replacement. You should be able to
simply change imports of dhtproto.client.legacy.internal.helper.ChannelMirror
to dhtproto.client.legacy.internal.helper.Mirror and instantiate a Mirror
object, instead of a ChannelMirror object.

Notes:

  • The new channel mirror does not reassign requests to connected nodes when
    there's an error on another connection. (This fixes a major problem in the old
    channel mirror.)
  • The new channel mirror is thus also suitable for use with applications that
    start their main functionality after a partial DHT handshake.
  • Due to the different internal implementation, the GetAll requests assigned by
    the new channel mirror may not be synchronised. This means that you can
    receive GetAll data from different nodes at different times. This is not
    expected to have any effect on applications, but is a noteworthy change in
    behaviour.

Extensible channel mirror works with new channel mirror class

dhtproto.client.legacy.internal.helper.ExtensibleChannelMirror

The new template -- ExtensibleMirror -- allows the extensible mirror
functionality to be used with the new Mirror class. Usage like:

alias ExtensibleChannelMirror!(SchedulingDhtClient,
    RawRecordDeserializer!(Record), DeserializedRecordCache!(Record))
    ExampleMirror;

should be changed to

alias ExtensibleMirror!(SchedulingDhtClient, Mirror!(SchedulingDhtClient),
    RawRecordDeserializer!(Record), DeserializedRecordCache!(Record))
    ExampleMirror;

v13.3.1 auto-converted to D2

v13.3.1

19 Mar 14:26
Compare
Choose a tag to compare