Skip to content

Releases: sociomantic-tsunami/ocean

v4.4.5 auto-converted to D2

v4.4.5

22 Mar 09:57
Compare
Choose a tag to compare

v4.5.2 auto-converted to D2

v4.5.2

31 Jan 17:26
v4.5.2
Compare
Choose a tag to compare

v4.5.1

31 Jan 16:06
v4.5.1
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/ocean/milestone/103?closed=1

  • travis: Fix testing of D2 tags #675
  • Auto conversion to D2 for tags is failing #674

v4.5.0 auto-converted to D2

v4.5.0

29 Jan 09:23
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/ocean/milestone/88?closed=1

Deprecations

Deprecation of suspend_queue configuration

Thanks to changes in scheduler/epoll internals, there is now no limit for how
many tasks can be temporarily suspended via theScheduler.processEvents() or
theScheduler.delayedResume(task). Because of that old configuration values
for these limits have been deprecated.

Features

toContextDg now supports return values

ocean.core.TypeConvert.toContextDg

Enhancement to existing utility function that converts function accepting a
single word size argument into a zero-argument delegate with no allocations. Now
it is possible to use a function with some return value, and resulting delegate
will have the very same return type.

Add utility methods for date and time validation

ocean.text.convert.DateTime

The methods validateTime and validateDate are now declared as public.
The methods are helpful for simple validation of dates or times defined as as strings in config files.

Wrapper for dynamic array with IQueue interface

ocean.util.container.queue.DynamicQueue

New module that wraps common pattern of using a dynamic array to imitate
infinitely growing queue. push is implemented as appending to the backing
array and pop as fetching elements from the beginning.

  auto queue = new DynamicQueue!(int);
  queue.push(1);
  queue.push(2);
  test!("==")(*queue.pop(), 1);
  test!("==")(*queue.pop(), 2);

Garbage Collector stats

  • ocean.application.components.GCStats,

    GCStats can be used with dmd-transitional in order to get stats about the
    garbage collector. It will collect:

    • gc_run_duration The number of microseconds the garbage collector ran
      for during the last collection cycle.
    • gc_run_percentage The percentage of time that was spent by the
      garbage collector during the last collection cycle.
  • ocean.util.app.DaemonApp

    DaemonApp class now contains the reportGCStats() method which will add
    the GC stats to the stats log file.

Helper to quickly spawn a task for scripting

  • ocean.task.util.QuickRun

Utility intended for script-like usage:

  int main ( )
  {
    initScheduler(SchedulerConfiguration.init);

    return quickRun({
      // use task-blocking functions:
      Dht.connect(10_000);
      Dht.put("channel", 23, "value");
      return 0;
    });
  }

It turns delegate argument into a task and runs it through scheduler. Starts the
event loop automatically and will finish only when all tasks finish and no
registered events remain (or theScheduler.shutdown is called).

Possible to get fiber stats for specialized pools

New method in IScheduler API - getSpecializedPoolStats:

    SchedulerConfiguration config;
    with (config)
    {
        specialized_pools = [
            PoolDescription("SomeTask", 10240)
        ];
    }
    initScheduler(config);

    // returns stats struct wrapped in `Optional`:
    auto stats = theScheduler.getSpecializedPoolStats("NonExistent");
    test(!stats.isDefined());

    stats = theScheduler.getSpecializedPoolStats("SomeTask");
    stats.visit(
      ( ) { /* not defined */ },
      (ref SpecializedPoolStats s) {
        Stdout.formatln("{} {}", s.free_fibers, s.used_fibers);
      }
    );

New bindings for OpenSSL and new SslClientConnection class

  • ocean.net.ssl.SslClientConnection

    This new class provides an asynchronous Task-based implementation of an SSL
    client. It provides connect, read, and write primitives, which are the
    basis for higher-level protoocols like HTTPS.

Add utility to wrap task as ISuspendable

  • ocean.task.util.TaskSuspender

New small utility that accepts task instance via constructor and implements
resume method via theScheduler.delayedResume of underlying task instance.
Makes possible to use tasks as suspendables without violating scheduler
requirements of not resuming one task via another directly.

auto generator = new GeneratorTask;
auto stream_processor = new StreamProcessor!(ProcessingTask);
stream_processor.addStream(new TaskSuspender(generator));

v4.4.4 auto-converted to D2

v4.4.4

29 Jan 08:25
Compare
Choose a tag to compare

v4.3.10 auto-converted to D2