Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a mashup of several things. I noticed that too late to separate them into several commits 😓
dicts
have been replaced with maps (except one, which I'm not sure about).start_link
functions now also accept maps on top of proplists, and the tests have been changed to use the maps variant. The functionproplists:to_map/1
used to convert proplists intomaps appeared only as late as OTP 24. For that reason, I backported this function (copied from https://github.com/erlang/otp/blob/master/lib/stdlib/src/proplists.erl#L704-L720) intodepcache
, to be usable when running on older (pre-24) OTP versions.start_link
is now validated, that is, config maps (and by extension, proplists) are not allowed to contain keys other thanmemory_max
andcallback
, and if present, the values are validated to be eitherundefined
, an integer >= 0 formemory_max
, or a tuple of module, function and arguments (see next two points). If a config is given that is by this definition invalid, abadarg
error is raised.mfa()
-{Module, Function,
Arity
}
- but were actually used in the code as{Module, Function,
Arguments
}
.callback
option can also be given with a single (non-list) value for the arguments, in which case it is reinterpreted to mean a single argument for the given Module:Function. This is ambiguous and therefore questionable, in fact it should be discouraged. The specs provided with this PR still keep that usage open (therefore theno_warn
directive forcallback/3
), but dialyzer will (should) complain if users use the single non-list variant forcallback
.tick
message has been received. This removes the need to flush missed ticks from the message queue.