Home Help Center

objective-c - using main_queue by ice dispatcher

Hello Guys,

i have seen in Ice touch examples you use the ice dispatcher with the main_queue
for example:
initData.dispatcher = ^(id<ICEDispatcherCall> call, id<ICEConnection> con)
{
dispatch_sync(dispatch_get_main_queue(), ^ { [call run]; });
};

if i understood, it means - all the AMI callbacks will be handled by the main_queue
we are implementing an ice client-server iphone application, do you suggest us to use the main_queue with the dispatcher or the global_queue ?

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    It's up to you to decide which queue is best :). Using the main queue is simpler if your AMI callbacks or servants need to call on UI objects because you are required to modify the UI from the main thread.

    If your AMI callbacks or servants don't modify the UI directly, you don't have to use a dispatcher or you can dispatch the callbacks on another queue.

    Cheers,
    Benoit.
Sign In or Register to comment.