v3.0.0: First fully public release!
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 callLog.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, useHttpResponseCode
instead.HttpResponseCode.init
is nowHttpResponseCode.OK
.
StatusCode
was atypedef
ofHttpResponseCode
, which is problematic with D2. Its mere purpose was to have theOK
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 soStatusCode
is no longer needed. HistoricallyStatusCode
was added because at that timeHttpResponseCode
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 onsignalfd
),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 withsignalfd
. -
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
andocean.text.convert.Layout_tango
have been replaced by corresponding new functions fromocean.text.convert.Formatter
. This is not expected to result in any changes to the users ofStructSerializer
orStringStructSerializer
. 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-introducedLogger
. It is now called fromLogExt
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
andocean.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 gotsetNonBlock
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 inocean.util.log.Log
, the main advantage being its usage ofocean.text.convert.Formatter
overocean.text.convert.Format
. This means thisLogger
will be able to logTypedef
in D2, to logstruct
and all types supported by theFormatter
.The difference between the
Logger
andLog
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 theLog
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 asprotected
but used from other modules/classes too. Corrected topublic
, 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 topublic
, though direct usage outside of ocean is discouraged. -
ocean.text.Util
PatternFruct
struct was marked asprivate
but used from other modules. Corrected topublic
. -
ocean.util.container.map.model.BucketSet
Bucket
alias was marked asprotected
but used from other modules/classes too. Corrected topublic
. -
ocean.util.container.cache.model.Value
Value
andValueRef
aliases were marked asprivate
but used from from other modules. Corrected topublic
. -
ocean.sys.SignalFD
SignalErrnoException
definition is nowpublic
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 serializingstructs
intostring
s, if thestruct
containstypedef
s, then thetypedef
fields were in the past formatted as a sub-struct with a single field calledvalue
. This is now fixed so thattypedef
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 serializingstructs
intostring
s, if the struct contains zero-lengthchar
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.