You are not logged in.
Pages: 1
Hi to everyone,
Looking for something like ServiceMethodUnRegister but couldn't find, how do i unregister a method at run-time? In my case, i am creating mvc applications with suburi on the fly for displaying a secure content, and it will dissmised itself at a certain time period. Mvc app freed but i can't use same suburi to create a new mvc app. Also, don't wanna use more custom suburi's, like timestamped, cause this means registering too many unnecessary suburi's to rest server.
Best regards
Offline
it's seems there is not. Anyway, i found my own solution with a different approach. Never mind this question. Thanks.
Offline
If you are referring to method based services you should not be adding or removing methods at runtime. It was not designed for it, also background logic is implemented using TDynArrayHashed which is not thread safe. I don't know what your solution is but if it's not jwt tokens it's probably a bad solution. Best regards
Last edited by pvn0 (Yesterday 12:15:04)
Offline
@pvn0 mORMot 2 does not use TDynArrayHashed but the TUriRouter dedicated class.
What you could do is hook before the regular routing with a callback at HTTP server level, then handle your custom routing at runtime from your own table.
Offline
@ab mORMot 2 uses both
mORMot2/src/rest/mormot.rest.server.pas
function TRestServer.ServiceMethodRegister(aMethodName: RawUtf8;
...
met := fPublishedMethods.AddUniqueName(aMethodName,
'Duplicated published method name %.%', [obj, aMethodName], @result);
end;fPublishedMethods is TDynArrayHashed and as result ServiceMethodRegister is not thread safe.
Sure its a remnant of mORMot 1 but is still used for several things. TUriRouter does not touch it, just the underlying dyn array so afaik could be removed to improve things.
Last edited by pvn0 (Yesterday 16:02:45)
Offline
Pages: 1