Structured Concurrency
Structured Concurrency
In this release we have dramatically simplified and improved the internal implementation of concurrency, removing a number of long standing defects arising from inconsistencies in async. Significant thanks are owed to the team behind ki for introducing a very powerful structured concurrency model. For our purposes, bi-directional exception propagation has been our goal and we've landed it using a simplified version of their approach.
In the case where you have waitThread
ed for a forked child you will now get the expected behaviour of both the child passing the exception . Here we define a "scope" as a simple Set of ThreadIds whose only purpose is to be able to cancel (kill) them if/when the scope exits. You can enter a new scope with the new createScope
function. We now have the correct behaviour when racing threads together, when using ^C to interrupt the program, and when a scope containing threads exits: an exception leaving the scope will cause the scope to kill its child threads. You can wait for a single thread or a list of threads (assuming they have the same return type). The helper functions for running two threads to completion or racing two threads now work in the face of either alternative having forked child threads.
This change requires a major API version bump due to the change to the internal representation (and so a change to the return type of internal function unThread
), deprecation of the linkThread
function, and overall changes of behaviour. The major version is now core-program 0.6.
- Fork forever threads by @istathar in #144
- Structured concurrency re-implementation by @istathar in #152
Robustness improvements for telemetry
Considerable work has been done in recent months to increase the robustness and polish of the observability implementation used to send telemetry to Honeycomb.
- Send "meta.span_type" field with root spans by @istathar in #127
- Fix overriding span start time by @istathar in #139
- Add instances to telemetry for dates and optionals by @koolray in #142
- Fix documentation to expose Telemetry class by @istathar in #141
- Enabling clearing trace if necessary by @istathar in #143
- New Telemetry instances for UTCTime and Maybe by @istathar in #145
- Preserve service name when clearing trace state by @istathar in #146
- Instance for sending UUIDs as metric values by @istathar in #147
- More instances relating to identifiers by @istathar in #148
Formatting and parsing of external data
New adapter class Externalize used to get data in and out of canonical external textual representations.
Bug fixes and general improvements
- Fix global help by @istathar in #136
- Fix assignment of values to required arguments by @istathar in #137
- Fix technique used to close stdin of child process by @istathar in #140
- Remove elements from Set and Map by @istathar in #151
New Contributors
Full Changelog: core-program-0.5.0.2...core-program-0.6.0.1