Results 1 to 4 of 4

Thread: Lianja.spawnApp and parameter

  1. #1
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,934

    Lianja.spawnApp and parameter

    Lianja.spawnApp conveniently allows running a .dbo (compiled prg) directly, as so:

    lcDbo = "myprg.dbo"
    lcPathedDbo = set("dire") + lcDbo
    Lianja.spawnApp(lcPathedDbo)

    Here's the challenge: I'm launching this from a web service (.rsp page application/json), and need to have the .dbo accept a parameter so that it processes a particular instance based on data pointed to by the parameter.

    Although SessionStorage might look like an answer, that has the same issue: I would need to communicate the "key" for the .dbo to access.

    Any suggestions?

    thanks,

    Hank

    PS: oops, just discovered that the .dbo isn't being run. Filing a bug. If it's being run, I might have a solution using spawnid() on the calling side and getid() on the running side to morph into the sessionstorage key.
    Last edited by HankFay; 2017-03-08 at 16:24.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,730
    Hi Hank

    You cannot use Lianja.spawnApp() from a server page. The Lianja system object is only available in the clients I.e desktop, web or mobile.

    Lianja.spawnApp() is desktop specific as it relies on being called from the lianja runtime client.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,934
    Hi Barry,

    OK, testing a wrapper for SPAWN so I don't have to think every time I use it. There's (almost) always a different way.

    thanks,

    Hank

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,730
    Hi Hank

    Rather than spawning a process from inside a web service I'd recommend you implement a consumer/producer architecture which will be much more scaleable.

    See my post in these forums on resource locks.

    You could add request records to a table in the web service always locking a known resource exclusively beforehand.

    You then have a background job (using cron on linux or task scheduler on Windows) running that reads records from the table and processes the requests. When there are no more requests, lock a known resource and zap the table then unlock the resource.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us