Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: REST API with SFTP Pooling

by Fletch (Chancellor)
on Nov 12, 2020 at 14:27 UTC ( #11123609=note: print w/replies, xml ) Need Help??


in reply to Re: REST API with SFTP Pooling
in thread REST API with SFTP Pooling

My initial thoughts were similar. Were I to do something like this I'd use it as an excuse to play with Mojolicious and its worker queue Minion. I'd make a worker task which would manage the SFTP connection, and you could have your Mojo app implementing the REST API. The worker task would maybe enqueue a keepalive request to itself for whatever interval (and to be fancy if it gets real work before then maybe cancel the prior keepalive and requeue a new one).

</slightly specific handwaving>

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^3: REST API with SFTP Pooling
by salva (Canon) on Nov 13, 2020 at 09:02 UTC
    Indeed, doing that with Minion seems pretty easy.

    In order to keep the SFTP connection alive, you can just set a timer (with Mojo::IOLoop::timer) for sending the dummy commands.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2021-05-07 19:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (93 votes). Check out past polls.

    Notices?