2
I Use This!
Very Low Activity

News

Analyzed about 12 hours ago. based on code collected 2 days ago.
Posted over 3 years ago by talexone
Thank you, the second option is what I need. I'll try that way.
Posted over 3 years ago by uian2000
Hi, ab.I am trying something similer to restws.longwork, with additional implementation of CallbackReleased procedure. IDataService = interface(IInvokable) ['{9DDC69FF-5212-4F64-9B98-ABFBF14A27D4}'] .... procedure CallbackReleased(const ... [More] callback: IInvokable; const interfaceName: RawUTF8); TDataService = class(TInjectableObjectRest, IDataService) protected fClients: TInterfaceDynArray; .... procedure TDataService.CallbackReleased(const callback: IInvokable; const interfaceName: RawUTF8); begin InterfaceArrayDelete(fClients, callback); end;When a client released, this procedure is processed then av occurred in mormot.core.interfacesprocedure TInterfaceMethodExecuteRaw.AfterExecute; var i, a: PtrInt; arg: PInterfaceMethodArgument; begin // finalize managed arrays for each call Finalize(fRawUtf8s); Finalize(fStrings); Finalize(fWideStrings); if fMethod^.ArgsManagedFirst >= 0 then begin for i := 0 to fMethod^.ArgsUsedCount[imvvObject] - 1 do fObjects[i].Free; for i := 0 to fMethod^.ArgsUsedCount[imvvInterface] - 1 do IUnknown(fInterfaces[i]) := nil; <-------------- av here Line7372Am I implementing it in a wrong way?My env: Win10/X64/Delphi XE/git@20220123Best regards. [Less]
Posted over 3 years ago by L_VV
Thank you, now all OK
Posted over 3 years ago by Chaa
See TInjectableObjectRest.
Posted over 3 years ago by okoba
Very interesting article.I like to know more about how you debug these problems, like the TAsyncServer case.
Posted over 3 years ago by tbo
Prometeus wrote:...but why was it necessary to create a 'packed record' type of the array of the fields loaded from the JSON, and not the array type itself? Sorry, I saw your mistake and should have added the explanation right away. But after the long day at work, I just wanted to turn off the computer as soon as possible.With best regardsThomas
Posted over 3 years ago by ab
My guess is that the easiest is to be able to disable some methods once registered.Not delete, but flag the method as disabled. So the indexes won't change, just the execution would be not allowed any more.
Posted over 3 years ago by ab
More complex joins are not supported.The ORM has limitations about the joins for sure.The idea is to focus on objects, not relations.Please check the documentation about the aggregate concept, for instance.
Posted over 3 years ago by ab
Yes, but then you will have to emulate the  "synopsejson" protocol over the wire... See TWebSocketProtocolJSON.FrameCompress and TWebSocketProtocolJSON.FrameDecompress for how the JSON content is encoded for incoming and outgoing frames, and how REST ... [More] is emulated.It is very powerful, but perhaps a bit complicated to implement from scratch. There is no JavaScript code available for it yet. As an alternative, you could define your own WS protocol, the use it via JS WebSocket(). You can add some custom protocols to your main TWebSocketServerRest instance as created by the useBidirSocket mode.You will have input/output JSON frames with no encapsulation.See the WS chat sample.I guess this is the easiest to do with a JS client. [Less]
Posted over 3 years ago by okoba
Thank you!