https://github.com/tinyj/tinyj-lazy
A thread and exception safe implementation of lazy (aka on-demand) value initialization.
https://github.com/tinyj/tinyj-lazy
functional functional-programming java lazy lazy-evaluation threadsafe tinyj
Last synced: 30 days ago
JSON representation
A thread and exception safe implementation of lazy (aka on-demand) value initialization.
- Host: GitHub
- URL: https://github.com/tinyj/tinyj-lazy
- Owner: tinyj
- License: other
- Created: 2017-02-09T07:14:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-28T19:34:27.000Z (over 8 years ago)
- Last Synced: 2025-07-24T09:16:15.523Z (7 months ago)
- Topics: functional, functional-programming, java, lazy, lazy-evaluation, threadsafe, tinyj
- Language: Java
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
tinyj-lazy [](https://travis-ci.org/tinyj/tinyj-lazy)
==========
A thread and exception safe implementation of lazy (aka on-demand) value
initialization.
Features:
- Initialization is guaranteed to run only once in multi-threaded scenarios
as well in case of raised exceptions
- The initializer is released after initialization so it can be collected by
the garbage collector. This is still true if initialization fails.
- Exception raised during initialization are propagated in the same thread
(this is important if a `InterruptedException` for that thread is raised
during initialization)
- Exceptions raised during initialization are kept for later inspection/logging
## API documentation
You can find the API documentation [here](APIdoc.md).
## Examples
See tests.
## License
Copyright 2016 Eric Karge
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.