Jump to content

Lars Fosdal

Administrators
  • Content Count

    3565
  • Joined

  • Last visited

  • Days Won

    120

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Receiving multiples JSON on Rest API Horse

    Does the response depend on the result of the processing? I.e. Does the response need to contain data from the processing. or return a different status if the processing failed?
  2. @Ann Lynnworth - that video link looks like a miss. Including a link to your site would be nice: https://www.href.com/rubicon Or is this just a clever spam bot? Fortunately, she's legit 🙂
  3. Lars Fosdal

    Receiving multiples JSON on Rest API Horse

    @David Schwartz - I think that he means that the server sends individual REST posts. @Andre Capelli - Just to be sure: The Backend (which uses the Horse libs) is where your Delphi code is. The Server is someone's server or service that place REST calls to your Backend. How is the connection established? Do you make a request, and then your Backend is subscribing to individual, asynchronous updates from the Server? IMO, if the Backend keeps receiving REST calls after connecting to the Server, a workable solution would be to queue the incoming JSON to a work queue, and then have a worker thread pool consuming from that queue. You do typically not want to do all the processing in the response handling, but hand it off to workers. It gets more complex if you must validate the results of handling the JSON to decide on the result code for the REST request, but if there is a Horse community, that would be the place to ask for how to deal with it. It sounds odd that the current processing is interrupted when a new REST request arrives. When you get multiple requests in Indy, each of them gets a thread of their own - and I use the above approach and have the response thread idle wait for a completion from the processing queue - or - after the specified time, return a timeout stat. My solution is not typical REST, but JSONRPC - which sort of is synchronous RPC in JSON format, but the challenge is the same. Worker threads save a lot of time when you need setting up the connections, lookup tables, and other forms of data that can be cached.
  4. Lars Fosdal

    Receiving multiples JSON on Rest API Horse

    Opening and closing the databaseconnection is expensive. You need a worker thread pool that where each worker thread keeps a connection to the database. I am still not sure that I understand your architecture and dataflow. Your example shows a single element: {"leads": [{json}]} - is that the typical REST request that you receive multiple times, or do you get {"leads": [{json1}], {json2}, ..., {json1000}]} ? That doesn't sound right? I don't know the Horse backend lib - so I don't know how to advise you on that.
  5. I'd be curious to see the resource requirements of a Miletus app. /off-topic Still a double use in the title.
  6. Lars Fosdal

    FMX Android Mouse pos X , Y and keyboard event

    The RD runs as a UI-less service, right? So it doesn't have a Window of its own and probably have special rights to capture the display activities and send events.
  7. /off-topic Your post title needs a little tweaking, me thinks. It is Miletus, not Melitus (which is diabetes). /on-topic Many industrial units have web interfaces built in - but these are one more attack vector - and if you are rolling your own - there is the issue of maintenance and even more stuff to deploy to the devices. Personally, I would not want to spend limited resources on an IoT unit on hosting a complex UI. Yes, it can be done this way - but - should it be done this way?
  8. Lars Fosdal

    Receiving multiples JSON on Rest API Horse

    Are you receiving multiple individual json packages (1), or is it one large package with an array of multiple json elements (2)? 1. {json}{json}{json} 2. {"list":[{json},{json},{json}]} How complex is each json element? Can you show us an example? Is it the insert to the DB that is time consuming or the decoding of the json? Are you opening and closing the DB connection for each json element?
  9. Lars Fosdal

    Receiving multiples JSON on Rest API Horse

    You need to give us a little more to work with. How complex are the json structures? Is it the backend or the client that will be written in Delphi? Is it the backend or the client that will receive 1000 jsons ? If the backend uses 1-2 seconds and it is not written in Delphi - that is not a Delphi problem.
  10. Lars Fosdal

    Parnassus Bookmarks for Delphi 11 Alexandria?

    I was signed up but didn't have time to watch it - when I tried some of the interesting replays, they were not working. Why don't they do a blog post about it and indicate a timeframe for availability? In a way, it is good that they have HighDPI issues since that means proper dogfooding, but I fear that we will be talking about update 1, and not a December hotfix. Judging from all the HighDPI issues I've seen discussed, the right thing to do would be to break the mold and do it right. The current approach with kludges and workarounds = tech debt++.
  11. Lars Fosdal

    Application to generate all cross platform images

    The dice example doesn't look well at the smaller sizes as particularly the lower right corner is not as round as it should be. Offering multiple downsampling algorithm options is a good idea.
  12. Lars Fosdal

    FMX Android Mouse pos X , Y and keyboard event

    Not sure that is possible as such functionality could violate security.
  13. Lars Fosdal

    Application to generate all cross platform images

    Although VCL apps need 16x16 too.
  14. Lars Fosdal

    Application to generate all cross platform images

    I would think that you could increase the potential number of users with quite a bit if you added VCL support as well 🙂 Edit: or even add it as a pro feature at a reasonable price.
  15. Lars Fosdal

    Application to generate all cross platform images

    I use the good old IcoFX 1.6.4 Portable Edition. KenR - how well does it resample for 32x32 and below? Most of the time, the smallest sizes need some TLC to look decent.
  16. Lars Fosdal

    Parnassus Bookmarks for Delphi 11 Alexandria?

    When there are reasons, there should be public information - but there is just silence.
  17. Lars Fosdal

    Hot Reload in Delphi?

    It is not that we don't see its importance, we just don't have any faith in EMBT's ability to pull it off.
  18. Lars Fosdal

    Application to generate all cross platform images

    Fortunately, ImageMagick is available for Linux, Windows, MacOSX and even iOS. https://imagemagick.org/script/download.php
  19. Lars Fosdal

    Application to generate all cross platform images

    Is sips open source? Is there a Windows version?
  20. Lars Fosdal

    Application to generate all cross platform images

    Good question... If you intend to distribute it for free, and it is a generic tool for Delphi - You could work with EMBT to get it packaged for GetIt? If the source code doesn't contain any commercial libs, there is the source code on GitHub option?
  21. Lars Fosdal

    Application to generate all cross platform images

    Personally, I would never download an .exe from a less known source.
  22. Lars Fosdal

    Application to generate all cross platform images

    What defines an image here?
  23. In 2017, there was an example on SO for Windows / OSX - not sure if it still is the appropriate way to do it? https://stackoverflow.com/questions/13326292/only-one-application-instance-with-firemonkey For iOS and Android - single instance is handled by the OS, isn't it? Edit: There also is an interesting comment at the end of this thread https://codeverge.com/embarcadero.delphi.firemonkey/only-one-application-instance-w/1049535
  24. Lars Fosdal

    Delphi on Windows 11 on MacBook Pro 16 (2021)

    Moved the post to Cross-platform. Ref. Obstacle 2: It is probably path related. For now, I had to move the Mac out of my office to not be tempted to tinker more on it, but get some actual paid work done. The lure of unfamiliar territory was too powerful to resist when within the reach of my fingers.
×