Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace context key tupels with records #279

Merged
merged 1 commit into from
Dec 17, 2020
Merged

Conversation

RoadRunnr
Copy link
Member

Instead of having to count fields in tuples, records allow us to
specify matches with the more readable record syntax.
They also give us tagged keys, that means we can deduce the type
of the key from the record tag.

This was originally part of the stateless work, but will also be
helpful for the cluster registry.

@RoadRunnr RoadRunnr requested a review from a team as a code owner December 16, 2020 13:08
@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.329% when pulling c84dc0a2a40d6b4789de4fb8fcb85074d2a44e9e on feature/reg-keys into 22ded94 on master.

Copy link
Contributor

@ebengt ebengt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@@ -973,9 +973,10 @@ path_failure() ->
[{doc, "Check that Create PDP Context works and "
"that a path failure (Echo timeout) terminates the session"}].
path_failure(Config) ->
CtxKey = #socket_key{name = 'irx', key = {imsi, ?'IMSI', 5}},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be an idea to define 5 to something more informative.


{GtpC, _, _} = create_pdp_context(Config),

{_Handler, Server} = gtp_context_reg:lookup({'irx', {imsi, ?'IMSI', 5}}),
{_Handler, Server} = gtp_context_reg:lookup(CtxKey),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (1418 + 1422) happens often enough to maybe merit its own function?

Instead of having to count fields in tuples, records allow us to
specify matches with the more readable record syntax.
They also give us `tagged keys`, that means we can deduce the type
of the key from the record tag.

This was originally part of the stateless work, but will also be
helpful for the cluster registry.
@RoadRunnr
Copy link
Member Author

updated, key types are better differentiated now.

@vkatsuba vkatsuba merged commit 09e97cb into master Dec 17, 2020
@vkatsuba vkatsuba deleted the feature/reg-keys branch December 17, 2020 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants