Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvDispatcher::create()

Method

## Declaration

    TibrvStatus create(
        TibrvDispatchable* dispatchable,
        tibrv_f64 idleTimeout = TIBRV_WAIT_FOREVER);

## Purpose

Start a dispatcher thread.

## Remarks

This method creates a C dispatcher thread and stores its handle in the C++ object.

A dispatcher thread repeatedly dispatches a queue or queue group.

Inside the thread, a loop calls TibrvDispatchable::timedDispatch(). If the timed dispatch call returns without dispatching an event (after waiting for `idleTimeout` seconds), then the thread exits by calling TibrvDispatcher::destroy().

Parameter | Description
    dispatchable
| The new thread dispatches this object, which can be either a queue or a queue group.
    idleTimeout
| When this time period (in seconds) elapses without dispatching an event, the thread exits. The special value `TIBRV_WAIT_FOREVER` instructs the dispatcher to loop indefinitely; the thread does not exit until the program explicitly destroys it. The special value `TIBRV_NO_WAIT` instructs the dispatcher to poll until no events are ready to dispatch, then exit.

## Stack Size

On UNIX platforms that use the POSIX thread package (`pthread`), this call sets the `stacksize` attribute of the dispatcher thread to the larger of two candidate values—either the default stack size of the operating system, or 64 kilobytes.

For programs that require a larger stack size, we recommend that you code a custom dispatcher thread.

## See Also

TibrvDispatchable::timedDispatch()

TibrvDispatchable

TibrvDispatcher::destroy()

TibrvDispatcher::setName()

DISPATCHER.THREAD_EXITED in TIBCO Rendezvous Concepts

tibrvDispatcher in TIBCO Rendezvous C Reference

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.