Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual Ndb::pollEvents2()

Description.  Waits for an event to occur. Returns as soon as any event data is available. This method also moves an epoch's complete event data to the event queue.

Added in NDB 7.4.3, this method supersedes pollEvents(), which is now deprecated and subject to removal in a future NDB Cluster release.


int pollEvents2
      int aMillisecondNumber,
      Uint64* highestQueuedEpoch = 0

Parameters.  This method takes the two parameters listed here:

  • The maximum time to wait, in milliseconds, before giving up and reporting that no events were available (that is, before the method automatically returns 0).

    In NDB 7.4.7 and later, specifying a negative value for this argument causes pollEvents2() to return -1, indicating an error (Bug #20762291).

  • The index of the highest queued epoch. Normally, this may safely be permitted to assume its default value, which is 0. If this value is not NULL and new event data is available in the event queue, it is set to the highest epoch found in the available event data.

Return value.  pollEvents2() returns an integer whose value can be interpreted as follows:

  • > 0: There are events available in the queue.

  • 0: There are no events available.

  • < 0: Indicates failure (possible error).