Commit Graph
16 Commits
Author SHA1 Message Date
Konrad `ktoso` Malawski 2891ee74b6 Slightly nicer string description for Signal (#42)
* Slightly nicer string description for Signal
* compat with swift before 5.3
2020-06-26 08:56:58 -07:00
tomer doron 19c52240e6 update api to remove Lifecycle psuedo namespace (#40)
motivation: address api feedback, do not clash module and type names

changes:
* remove top level Lifecycle psuedo namespace (enum)
* rename Lifecycle.Task to LifecyclTask
* rename Lifecycle.Handler to LifecycleHandler
2020-05-27 19:20:26 -07:00
tomer doron 77c2610f87 rename project to SwiftServiceBootstrap (#36)
motivation: better name

changes:
* update license headers
* update sanity checks
2020-04-09 21:23:49 -07:00
tomer doron a22bf0b3be refactor towards 1.0 (#34)
motivation: finalize naming and API towards 1.0

changes:
* rename package to swift-service-boostrap
* rename modules to Lifecycle and LifecycleNIOCompat
* create top level namespace named Lifecycle
* rename LifecycleItem to LifecycleTask, with Lifecycle.Task typealias
* define top-level type called ServiceLifecycle where signal handling and backtraces are handled
* rename Lifecycle to ComponentLifecycle and conform it to Lifecycle.Task so that lifecycles can be nested
* change shutdown to return an error to better conform with Lifecycle.Task api
* improve logging
* improve API docs
* adjust tests
2020-04-09 21:15:22 -07:00
tomer doron 0052995d30 small refactoring (#31)
motivation: prepare for OSS

changes:
* rename the internal _shutdown function to shutdownItem
* add and improve few tests
2020-04-07 13:55:11 -07:00
Konrad `ktoso` Malawski a9ec3083bd Dont use label for callbacks intended to be used as trailing (#30)
Resolves #26
2020-04-07 12:33:41 -07:00
tomer doron af5fb960b0 provide programatic access to shutdown errors (#17)
motivation: in some cases users may want access to the shutdown errors

changes: add optoinal callback to shutdown providing access to shutdown errors
2020-04-05 13:52:19 -07:00
Johannes Weiss 541cf1bb7c correctness: shutdown while hanging start (#19)
motivation: fix correctness issue when shutting down while hanging start use case

changes:
* only shutdown started items when shutting down while starting
* refactor shutdown to use the configured callback queue from start, instead of a separate one
* add correctness tests
2020-04-05 11:48:03 -07:00
Johannes Weiss ffe82de1c6 replace semaphores with locks (#18)
motivation: Semaphores are not locks, if they are released too often by accident, we
will get into deep trouble because there's no longer mutual exclusion.

changes: use posix mutex
2020-04-04 00:48:30 -07:00
tomer doron c62901ab92 rename LifecycleItem::name to LifecycleItem:label (#22)
motivation: more swifty API, along the lines of DispatchQueue, Logger, Metrics

changes:
* rename LifecycleItem::name to LifecycleItem:label
* adjust tests
2020-04-04 00:43:30 -07:00
tomer doron a38e8dcd63 dont overload async in NIOCompat (#16)
motiavtion: less overloading == less confusion

changes: rename async in NIOCompat to eventLoopFuture
2020-04-02 21:22:22 -07:00
tomer doron 070734a734 rename module (#12)
motivation: adjust module name to avoid ambiguity between module and main type

changes: rename Lifecycle to ServiceLauncher
2020-03-31 20:08:32 -07:00
tomer doron ae96513515 add default config (#7)
motivation: make API easier to use

changes: add default value to configuraiton argument
2020-03-27 16:27:28 -07:00
tomer doron 46a98e2852 refactor "append" api (#3)
motivation: simplify registering items based on closures

changes:
* rename append to register
* introduce a Handler object that is an enum of sorts for types of startup and shutdown handler signature we support
* refactor tests to use the new code
2020-03-23 11:35:55 -07:00
tomer doron e7ec8da443 remove deprecated methods (#4)
motivation: no need in deprecated methods since we did not tag yet

changes: remove deprecated start and startAndWait methods
2020-03-19 20:37:11 -07:00
Tom Doron 1abe527c92 initial commit 2020-03-18 11:56:30 -07:00