Home Help Center

AMI or not AMI depending on slice args?

stepanchegstepancheg Member Stepan KoltsovOrganization: YandexProject: Test
Hi, all.

is it possible to declare slice so that same declaration will be suitable for AMI or for direct invocation depending on slice command flags?

We have a service and two clients.

One client should use AMI, and other should call same methods synchronously. We'd like to have same slice interface definition file for two clients. Is it possible?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    When you add the "ami" metadata to a Slice operation, it causes the Slice compiler to generate an asynchronous version of the proxy method in addition to the synchronous version. Clients can use whichever style is appropriate.

    Note however that the same is not true in a servant when you specify the "amd" metadata. In this case, the asynchronous servant method replaces the synchronous version.

    Take care,
    Mark
  • stepanchegstepancheg Member Stepan KoltsovOrganization: YandexProject: Test
    Thank you, I mixed up "ami" and "amd".
Sign In or Register to comment.