Explicit/Short hand methods for lazy delegations(I...
# stdlib
e
Explicit/Short hand methods for lazy delegations(In addition to
lazy()
, as in
lazyNone()
,
lazyPublication()
, and
lazySyncronized()
, instead of
lazy(LazyThreadSafetyMode)
m
IMO
lazySynchronized
is harder to type / spell in the brain for non-english speakers. Even you made a mistake 🧌
lazyThreadSafe
would be better but I don't really see any point in it,
lazy
is synchronized by default:
Creates a new instance of the Lazy that uses the specified initialization function initializer and the default thread-safety mode LazyThreadSafetyMode.SYNCHRONIZED.
Also, what is
lazyPublication
?
e
One of the 3 options
m
Oh I see now, never used it, I'll dive in. Thanks
e
IIRC it's that you can call it without being blocked but only the value from the first one is stored
Any regarding spelling, it's no easier to type than specifying the enum in the
lazy
method, just a bit of a QOL thing
m
There is already this proposal which will allow us to omit enum name and just type
lazy(PUBLICATION)
. It is even mentioned in the examples.