| 1 | # Licensed to Elasticsearch B.V under one or more agreements. | ||
| 2 | # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
| 3 | # See the LICENSE file in the project root for more information | ||
| 4 | |||
| 5 | package Search::Elasticsearch::Async::Util; | ||
| 6 | $Search::Elasticsearch::Async::Util::VERSION = '7.30_1'; # TRIAL | ||
| 7 | |||
| 8 | $Search::Elasticsearch::Async::Util::VERSION = '7.301'; | ||
| 9 | use Moo; | ||
| 10 | use Scalar::Util qw(blessed); | ||
| 11 | use Sub::Exporter -setup => { exports => ['thenable'] }; | ||
| 12 | |||
| 13 | #=================================== | ||
| 14 | sub thenable { | ||
| 15 | #=================================== | ||
| 16 | return | ||
| 17 | unless @_ == 1 | ||
| 18 | && blessed $_[0] | ||
| 19 | && $_[0]->can('then'); | ||
| 20 | return shift(); | ||
| 21 | } | ||
| 22 | 1; | ||
| 23 | |||
| 24 | # ABSTRACT: A utility class for internal use by Elasticsearch | ||
| 25 | |||
| 26 | __END__ |