Hi, all.
I am refactoring my mojolicious app.
Is there any way to use promise and keep the same return value?
For example:

My original  method:
sub some_method {
  my $a = block_function_a();
  my $b = block_function_b();
  my $c = block_function_c();  ### for example many Mojo::Pg search 
  return $a+$b+$c;
}

Now I change block_function_c to  an unblocked promise.

sub some_method {
  my $a = block_function_a();
  my $b = block_function_b();
  return promise_mojo_db_search->then(sub($c){  
       $a+$b+c;
   }
);
}

I have to change many relative code after the return value change.
It is very annoying.
Is there any way to return the same value with promise.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/dc953efc-e445-435e-afcb-18d94cd76ab7n%40googlegroups.com.

Reply via email to