GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GraphQL::AsyncIterator(3) User Contributed Perl Documentation GraphQL::AsyncIterator(3)

GraphQL::AsyncIterator - iterator objects that return promise to next result

  use GraphQL::AsyncIterator;
  my $i = GraphQL::AsyncIterator->new(
    promise_code => $pc,
  );
  # also works when publish happens before next_p called
  my $promised_value = $i->next_p;
  $i->publish('hi'); # now $promised_value will be fulfilled

  $i->close_tap; # now next_p will return undef

Encapsulates the asynchronous event-handling needed for the publish/subscribe behaviour needed by GraphQL::Subscription.

A hash-ref matching "PromiseCode" in GraphQL::Type::Library, which must provide the "new" key.

Resolves the relevant promise with @values.

Rejects the relevant promise with @values.

Returns either a "Promise" in GraphQL::Type::Library of the next value, or "undef" when closed off. Do not call this if a previous promised next value has not been settled, as a queue is not maintained.

The promise will have each of the sets of handlers added by "map_then" appended.

Switch to being closed off. "next_p" will return "undef" as soon as it runs out of "publish"ed values. "publish" will throw an exception. NB This will not cause the settling of any outstanding promise returned by "next_p".

Adds the handlers to this object's list of handlers, which will be attached to promises returned by "next_p". Returns self.
2021-07-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.