Skip to content

v3.0.0: First fully public release!

Compare
Choose a tag to compare
@leandro-lucarella-sociomantic leandro-lucarella-sociomantic released this 10 Mar 14:58
· 1308 commits to v6.x.x since this release
v3.0.0

Big News

Starting from this release all the development of Ocean has been moved to this public repository! Expect a lot more of activity in this repository, including pull requests and timely releases instead of arbitrary sync points.

Migration Instructions

  • ocean.util.log.Config

    This module will no longer clear all appenders of Log.root on module construction. User code needing to do so can manually call Log.root.clear() where needed.

  • ocean.util.serialize.contiguous.Contiguous,
    ocean.util.serialize.contiguous.Serializer,
    ocean.util.serialize.contiguous.DeSerializer

    Remove support for pointers. This feature is broken in Contiguous, and Serializer/Deserializer don't support it. In Contiguous pointers of type T* were assumed to point to one object, whose data are stored in the contiguous buffer. However, since a pointer may point to the first element in an array and the length of the array isn't known from just the pointer, this is a wrong and therefore dangerous assumption. Moreover, void* was assumed to point to a one-byte (void.sizeof) object.

  • ocean.util.log.model.ILogger

    Formatting functions (trace, info, warn, error, fatal) have been removed from the ILogger interfaces.
    Those are not compatible with the future logger, which will use templates. It was not possible to deprecate them either, as the deprecation would have affected the widely used overrides.

  • ocean.net.http.consts.StatusCodes, ocean.net.HttpConst.HttpResponseCode,
    ocean.net.http.HttpConnectionHandler, ocean.net.http.HttpException

    • StatusCode has been removed, use HttpResponseCode instead.
    • HttpResponseCode.init is now HttpResponseCode.OK.

    StatusCode was a typedef of HttpResponseCode, which is problematic with D2. Its mere purpose was to have the OK value as the initial value as required by the Sociomantic HTTP etiquette (i.e. when in doubt, respond with "200 OK"). HttpResponseCode now satifies this requirement so StatusCode is no longer needed. Historically StatusCode was added because at that time HttpResponseCode was code maintained by the Tango team which we couldn't ask for introducing changes reflecting our business policy.

  • ocean.util.app.ext.SignalExt

    Instead of SignalEvent (based on signalfd), SignalExt is now installing regular signal handlers and relies on the regular signal dispatch mechanism in combination with self-pipe trick used for epoll callback synchronisation. This allows better behaviour with gdb, since the signals are no longer blocked and caught with signalfd.

  • ocean.io.serialize.StringStructSerializer

    When serializing structs into strings, if the struct contains zero-length non-character arrays, then they would be previously formatted as [] but without a space following the preceding colon. An extra space has now been added between the colon and [].

  • ocean.io.serialize.StructSerializer, ocean.io.serialize.StringStructSerializer

    Old formatting functions from ocean.text.convert.Format and ocean.text.convert.Layout_tango have been replaced by corresponding new functions from ocean.text.convert.Formatter. This is not expected to result in any changes to the users of StructSerializer or StringStructSerializer. However, it is recommended to keep an eye out for potential inconsistencies in the serialized output before and after updating.

New Features

  • ocean.util.log.Config

    A new function, configureNewLoggers, was added to allow configuration of the newly-introduced Logger. It is now called from LogExt as well, so one can selectively use the old or new logger and expect them to be configured the same.

  • ocean.util.app.ext.LogExt

    This extension will now configure both old and new logger (ocean.util.log.Log and ocean.util.log.Logger, respectively). Note that Logger won't belong to the same hierarchy, so while their initial configuration will match, any later tweak (e.g. adding an Appender, changing the level...) will only be reflected to the same kind of logger.

  • ocean.io.device.Device

    Device now got setNonBlock method which can be used to move device read/write operations into non-blocking mode, if supported by device.

  • ocean.util.log.Logger

    This new module features a Logger implementation, similar to the one in ocean.util.log.Log, the main advantage being its usage of ocean.text.convert.Formatter over ocean.text.convert.Format. This means this Logger will be able to log Typedef in D2, to log struct and all types supported by the Formatter.

    The difference between the Logger and Log modules should be minimal, mostly related to the formatting primitive (Logger.{trace,info,warn,error,fatal}) being templated functions in the new implementation vs functions with variadic arguments in the old.

    In order to make the migration as painless as possible, the Logger module reuses the same names as the Log module, which means most code will only need to change their import to switch to the new implementation, by e.g. running:

    find src -name "*.d" -print0 | xargs -0 -n50 sed -i 's/ocean\.\util\.log\.Log/ocean.util.log.Logger/g'

    from a project's top level directory.

    The app framework will automatically configure the new logger as it configures the old logger. See release notes for ocean.util.log.Config for more details.

  • ocean.io.device.Device

    Device.reopen was marked as protected but used from other modules/classes too. Corrected to public, though direct usage outside of ocean is discouraged.

  • ocean.util.serialize.model.VersionDecoratorMixins

    convert method of matching mixin was marked as private but used from other modules. Corrected to public, though direct usage outside of ocean is discouraged.

  • ocean.text.Util

    PatternFruct struct was marked as private but used from other modules. Corrected to public.

  • ocean.util.container.map.model.BucketSet

    Bucket alias was marked as protected but used from other modules/classes too. Corrected to public.

  • ocean.util.container.cache.model.Value

    Value and ValueRef aliases were marked as private but used from from other modules. Corrected to public.

  • ocean.sys.SignalFD

    SignalErrnoException definition is now public so that it can be caught or extended in any other module.

  • ocean.util.app.DaemonApp

    OptionalSettings.ignore_signals may be used to specify a set of signals to be ignored by the application. Signals in this set will not be passed to the default signal handler.

  • ocean.util.app.ext.SignalExt

    Users can now specify that certain signals be ignored by the application, via an array passed to the constructor or the new method ignore. This feature can be useful for disabling the default handler for a signal.

  • ocean.io.serialize.StringStructSerializer

    This is only applicable to D2 builds.
    When serializing structs into string s, if the struct contains typedef s, then the typedef fields were in the past formatted as a sub-struct with a single field called value. This is now fixed so that typedef fields are correctly resolved to their base types and formatted without the introduction of any nested sub-structs.

    This is applicable to both D1 & D2 builds.
    When serializing structs into string s, if the struct contains zero-length char arrays, then they'll be formatted as "" (in the past, zero-length char arrays were not formatted at all).

Deprecations

  • ocean.core.Exception_tango

    This module was renamed to ocean.core.ExceptionDefinitions to better represent its content.

  • ocean.io.FilePath_tango

    This module was merged into ocean.io.FilePath and deprecated.

  • ocean.io.Stdout_tango

    This module is deprecated, use ocean.io.Stdout instead.

  • ocean.core.Traits_tango

    This module was merged into ocean.core.Traits and deprecated.