| 1 | package Search::Elasticsearch::Async::Util; | ||
| 2 | $Search::Elasticsearch::Async::Util::VERSION = '6.80'; | ||
| 3 | use Moo; | ||
| 4 | use Scalar::Util qw(blessed); | ||
| 5 | use Sub::Exporter -setup => { exports => ['thenable'] }; | ||
| 6 | |||
| 7 | #=================================== | ||
| 8 | sub thenable { | ||
| 9 | #=================================== | ||
| 10 | return | ||
| 11 | unless @_ == 1 | ||
| 12 | && blessed $_[0] | ||
| 13 | && $_[0]->can('then'); | ||
| 14 | return shift(); | ||
| 15 | } | ||
| 16 | 1; | ||
| 17 | |||
| 18 | # ABSTRACT: A utility class for internal use by Elasticsearch | ||
| 19 | |||
| 20 | __END__ |