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

readonly support for the parameters of remote methods #424

Merged
merged 7 commits into from
Jan 26, 2022

Conversation

ayeshLK
Copy link
Member

@ayeshLK ayeshLK commented Jan 26, 2022

Purpose

$subject

Related to #2604

Examples

With this change, developers could use readonly parameters for remote methods in websubhub:Service declaration:

service /websubhub on hubListener {
    isolated remote function onRegisterTopic(readonly & websubhub:TopicRegistration msg) returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError {
        // implement logic here
    }

    // implement other remote methods
}

readonly can only be applied to records declared in WebSubHub package. Hence, following will be invalid:

service /websubhub on hubListener {
    isolated remote function onRegisterTopic(readonly & websubhub:TopicRegistration msg, readonly & http:Headers headers) returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError {
        // implement logic here
    }

    // implement other remote methods
}

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests

@ayeshLK ayeshLK removed the request for review from shafreenAnfar January 26, 2022 09:19
@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #424 (b250ffe) into main (0f2b6d5) will increase coverage by 2.16%.
The diff coverage is 94.73%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #424      +/-   ##
============================================
+ Coverage     85.90%   88.06%   +2.16%     
- Complexity       22       37      +15     
============================================
  Files            15       15              
  Lines           759      796      +37     
  Branches        449      461      +12     
============================================
+ Hits            652      701      +49     
+ Misses          105       91      -14     
- Partials          2        4       +2     
Impacted Files Coverage Δ
...stdlib/websubhub/NativeHttpToWebsubhubAdaptor.java 94.93% <94.73%> (+6.84%) ⬆️
ballerina/commons.bal 91.80% <0.00%> (+3.27%) ⬆️
ballerina/subscription.bal 91.73% <0.00%> (+6.61%) ⬆️
ballerina/natives.bal 100.00% <0.00%> (+7.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f2b6d5...b250ffe. Read the comment docs.

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.

3 participants