-
Notifications
You must be signed in to change notification settings - Fork 377
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
Runtime modifications to a published service #162
Comments
Hey, If you have any questions regarding the implementation don't hesitate to get in contact. We shall offer as much support as we can. |
Linking original StackOverflow question for completeness. |
If the service is running on a single threaded mode or a multi-threaded mode (lets say 4 workers); is it possible that the number of threads accessing the paths and the methods will exceed the number of allowed workers in service_impl? |
Users can set any thread limit via |
The safest approach is to lock the resources via a std::mutex. This will block the service when engaged and should be held for the shortest possible duration. |
Yes, I first I thought so, but this will have a very bad performance impact on a multi-threaded service. Even if there is no changes, one thread will be blocking another thread from reading the paths and methods. I am thinking to find some other good approach to minimize the impact. |
Why not only lock the resources when writing? Anything that doesn't intend to write shall just have to check if its clear to move ahead, otherwise schedule itself for processing at a later date. |
Yes, I was thinking the same, doing some sort of combination of reading_counter and lock to enable lock for readers when the writing is going on, otherwise just execute the code. But I will go according to your suggestion. Thanks |
Have a look at Service::schedule( ); That will place the task back on the run-loop for later processing. Alternatively you could use Session::sleep_for but you'd have to guess how long to sleep for. |
I tried to lock the resource before writing and reschedule the reading function, but Service::schedule() does not take any parameters. Although Session::sleep_for() should be able to do the required task. So, instead of going for guess work; I did implement the combination of reader_counter and lock in service_impl; wrote a sample example and tested it. I have to do a smoke test with curl script. |
Hi how can I perform pull request for code review? |
Please review Creating a Pull Request. |
Just informing any other viewers. This feature won't be mainlined until after the 4.5 release. |
hi all, thank you very much |
Hi michel,
checkout the branch and rebase it to master (easiest I guess).
Thanks and regards
…On Wed, Nov 1, 2017 at 10:10 AM, michel ***@***.***> wrote:
hi all,
i'd like to use this feature
can someone explain how to apply this patch
or does someone know when it is planned for release
thank you very much
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#162 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAi1_UUFP3iCDoZ0gH2sMvIteBSmAOSVks5syHvVgaJpZM4KrdhG>
.
--
with best regards,
Nazmul Alam Shovon
*শুভেচ্ছান্তে, নাজমুল আলম শোভন*
blog : https://yourdigitaleffects.wordpress.com/
|
thanks for your answer but i'm not sure to have a good git level :) thank you and sorry for my poor git skills ;) |
Hi Michel,
1. Clone the repo with patch
*git clone https://github.com/fadedreamz/restbed.git
<https://github.com/fadedreamz/restbed.git>*
2. switch to the branch
*git checkout dynamic_publishing*
2. rebase it to master:
*git rebase master*
You will have the updated restbed with the patches at this point.
Regards,
…On Fri, Nov 3, 2017 at 1:05 PM, michel ***@***.***> wrote:
thanks for your answer
but i'm not sure to have a good git level :)
could you details a little more?
thank you and sorry for my poor git skills ;)
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#162 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAi1_ZnPH1xY5LX3oPnlyf05VsEtiRghks5sy0fxgaJpZM4KrdhG>
.
--
with best regards,
Nazmul Alam Shovon
*শুভেচ্ছান্তে, নাজমুল আলম শোভন*
blog : https://yourdigitaleffects.wordpress.com/
|
thank you!
Le ven. 3 nov. 2017 à 18:17, fadedreamz <[email protected]> a écrit :
… Hi Michel,
1. Clone the repo with patch
*git clone https://github.com/fadedreamz/restbed.git
<https://github.com/fadedreamz/restbed.git>*
2. switch to the branch
*git checkout dynamic_publishing*
2. rebase it to master:
*git rebase master*
You will have the updated restbed with the patches at this point.
Regards,
On Fri, Nov 3, 2017 at 1:05 PM, michel ***@***.***> wrote:
> thanks for your answer
>
> but i'm not sure to have a good git level :)
> could you details a little more?
>
> thank you and sorry for my poor git skills ;)
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub
> <#162 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAi1_ZnPH1xY5LX3oPnlyf05VsEtiRghks5sy0fxgaJpZM4KrdhG
>
> .
>
--
with best regards,
Nazmul Alam Shovon
*শুভেচ্ছান্তে, নাজমুল আলম শোভন*
blog : https://yourdigitaleffects.wordpress.com/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#162 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFj5A70yb6hbQzbuSTKjxdC18IalsFNTks5sy0q9gaJpZM4KrdhG>
.
|
this feature could be push in the 5.0 To Do list |
Dynamic publishing of new URI resource after a service has been started
Current implementation does not allow to change the published service.
The text was updated successfully, but these errors were encountered: