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

Actor: Get existing reminder by name #772

Closed
ssm3ll opened this issue Oct 19, 2021 · 9 comments
Closed

Actor: Get existing reminder by name #772

ssm3ll opened this issue Oct 19, 2021 · 9 comments
Assignees
Labels
area/actor kind/bug Something isn't working
Milestone

Comments

@ssm3ll
Copy link

ssm3ll commented Oct 19, 2021

Expected Behavior

As per official documentation https://docs.dapr.io/reference/api/actors_api/#get-actor-reminder it is possible to get existing reminder by its name. So Actor should contain method GetReminderAsync(string reminderName) to get existing reminder, that has been previously created using RegisterReminderAsync (string reminderName, byte[] state, TimeSpan dueTime, TimeSpan period) method

Actual Behavior

Currently it's only possible to register or unregister reminder

Steps to Reproduce the Problem

Nor Actor neither DaprHttpInteractor contain method to get existing actor reminder by it's name

@ssm3ll ssm3ll added the kind/bug Something isn't working label Oct 19, 2021
@rynowak
Copy link
Collaborator

rynowak commented Oct 19, 2021

Hi @ssm3ll,

You're right that we don't surface this through the Actors SDK. Do you have a use case in mind here? What do you plan to do with the data you will get?

That information will help us prioritize this as well as determine how it should be designed.

@ssm3ll
Copy link
Author

ssm3ll commented Oct 27, 2021

Hi @rynowak,

I assume method should return IActorReminder instance if reminder exists, so it will be possible to read reminder details like due date etc. Main use case is to check if reminder has been already created. We have a method in actor witch receives driver location. If it was the first location for him then a reminder is created. that reminder changes driver state based on last location timestamp.

@tstojecki
Copy link

In the absence of this, is there any downside to registering a reminder with the same name with each request in a controller? We have a service that uses an actor to get/set state and want to have one instance of a reminder running at all times.

@fabistb
Copy link

fabistb commented Mar 26, 2023

@halspang Is it possible to surface this api via the SDK?
Based on my tests the reminder API behavior changes when reminder partitioning is activated.

If reminder partitioning isn't activate UnregisterReminder() returns 200 even if no reminder is currently active.
This makes it possible to call the method in an optimistic if it isn't clear if a reminder is currently active or not.

However if reminder partitioning is activate UnregisterReminder() returns 500 if no reminder is currently active.
With this change the best way is probably to call the Get actor reminder api validate the response and only if a reminder is active utilize the UnregisterReminder() method. So it would be helpful if the Get actor reminder api could also be surfaced via sdk.

@halspang halspang added this to the v1.11 milestone Mar 29, 2023
@shivamkm07
Copy link
Contributor

/assign

@shivamkm07
Copy link
Contributor

@fabistb @ssm3ll Get Actor Reminder API has been added in Dotnet sdk in 1.11. GetActorReminder returns IActorReminder Object if the reminder exists, otherwise null. Feel free to try this and let us know in case of any issues.
P.S. I will be creating Docs PR soon for the change.

@shivamkm07
Copy link
Contributor

@halspang This issue can be closed now.

@fabistb
Copy link

fabistb commented Jun 14, 2023

@shivamkm07 thank you very much!
Just tried it and returned all the information I'm interested in.

@ssm3ll
Copy link
Author

ssm3ll commented Jun 16, 2023

@fabistb @ssm3ll Get Actor Reminder API has been added in Dotnet sdk in 1.11. GetActorReminder returns IActorReminder Object if the reminder exists, otherwise null. Feel free to try this and let us know in case of any issues. P.S. I will be creating Docs PR soon for the change.

thank you. it works

@halspang halspang closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/actor kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants