Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Multiuser app with SQLite, Dancer2 and CLI

by Anonymous Monk
on Dec 05, 2018 at 15:13 UTC ( #1226769=note: print w/replies, xml ) Need Help??


in reply to Multiuser app with SQLite, Dancer2 and CLI

Weird idea: interface your CLI to Dancer2 using LWP::UserAgent or HTTP::Tiny. Depending on your application, you could have the CLI request the data in text rather than HTTP (requiring a template for each format, I think) or scrape the HTTP (with the usual caveat about the fragility of such things).

  • Comment on Re: Multiuser app with SQLite, Dancer2 and CLI

Replies are listed 'Best First'.
Re^2: Multiuser app with SQLite, Dancer2 and CLI
by bliako (Monsignor) on Dec 05, 2018 at 16:04 UTC

    Or do completely the opposite: have your Dancer2 app accept only CLI commands as parameter which then delegates to your CLI. Which means: write first your CLI parser and functions, then worry about how to communicate with it. If you write it as a module, you could do something like my $cli = new CLI($params); my $res = $cli->process($commands, $data); either from a Dancer2 app or from a socket listener or from the command line.

Re^2: Multiuser app with SQLite, Dancer2 and CLI
by markong (Pilgrim) on Dec 05, 2018 at 22:27 UTC

    ++ for this approach: I'd add that you could (with a varying level of effort depending on the actual code) expose a REST API (XML/JSON) and having whatever client connecting to the "core" app through HTTP!

    In any case I'd recommend to swap SQLite for multi-user RDBMS, or you're destined to hit a bottleneck.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226769]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-12-09 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?