[Mojolicious] How to use put_p or put properly in the controller?

2020-07-15 Thread Gordon Dollarnanda
hi guys, Just started on a project with Mojolicious. Task: to upload a file into mojo and then issue a PUT command to transfer that file to a file server. I have been struggling to find documentation on using put_p/put in terms of the parameters for the syntax. Often, looking at https://mo

Re: [Mojolicious] How to use put_p or put properly in the controller?

2020-07-15 Thread Gordon Dollarnanda
lf->ua->put_p($url, $file_object->asset->slurp); > > You will probably also want to set a Content-Type header for the MIME type > of the file contents. This would be set by a hash between the URL and > content, there are some examples in > https://metacpan.org/pod/

[Mojolicious] How to construct a mojo request with file uploads to test a controller?

2020-07-24 Thread Gordon Dollarnanda
Hi guys, Good day. I have my controller working perfectly for file uploads. I get my file uploads by doing *my* *@file_uploads* = *@{* *$self->req->uploads*() *}*; I tried writing the test before development but due to time constraints, I had to cheat and use something else like a

Re: [Mojolicious] How to construct a mojo request with file uploads to test a controller?

2020-07-24 Thread Gordon Dollarnanda
into the post_ok() body? Thank you On Friday, 24 July 2020 at 21:24:33 UTC+10 rabbi...@gmail.com wrote: > In the test, you're sending your files as JSON. Don't you mean to send > them as a multipart file upload, using the multipart generator. > > On Fri, Jul 24, 2020 a

Re: [Mojolicious] How to construct a mojo request with file uploads to test a controller?

2020-07-24 Thread Gordon Dollarnanda
I had also looked at https://mojolicious.narkive.com/5XGiHXfh/test-mojo-with-uploading-files. I had implemented the changes as below to no avail. The code I used is "$t->post_ok( $request_url, $upload )->status_is(200, q{Success in upload} );" The uploaded files still do not get shown in m

[Mojolicious] how do i get the pid of a minion::job?

2020-08-12 Thread Gordon Dollarnanda
hi I noticed that there is a pid method in minion::job object but it doesnt necessarily return the pid. I checked minion::job::Pg::backend and there is a mention on pid but nothing concrete. How does one get the pid for a minion::job object reliably or there wants a strong requirement to expo

[Mojolicious] Re: how do i get the pid of a minion::job?

2020-08-12 Thread Gordon Dollarnanda
>From what i can tell , i revisited the docs and code in Minion and seems to me that the relationship between jobs and workers is many to many. If this is not right, please let me know. *HOW START, STOP AND RESTART WORK:* a) when START is called on a given job, it returns a process id. See

[Mojolicious] With Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then" clause?

2020-09-25 Thread Gordon Dollarnanda
hi, guys, Been reading up https://docs.mojolicious.org/Mojo/IOLoop/Delay https://docs.mojolicious.org/Mojolicious/Guides/Cookbook and a few threads in the group. Apologies if i had missed this in advance but with Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then"

[Mojolicious] Re: With Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then" clause?

2020-09-25 Thread Gordon Dollarnanda
ep 2). 6. Will test for the job result's values against my expected values (part of Test::More). Step 3 is the reason for me to want to plant a delay in the 'then()' section of the promise in step 1. On Friday, 25 September 2020 at 17:08:01 UTC+10 Gordon Dollarnanda wrote: &g