Download Description

Transcript
GroupKit Reference - gk::service
gk::service
Locate and connect to specific facilities offered by other
processes
Synopsis
gk::service provider providerName -type type -handler handler ?-registry
registry? ?-name name?
gk::service subscriber subscriberName -type type ?-name name?
?-registry registry ?-host host? ?-socket socket?
Description
The gk::service command provides an interface to both providing and
using services. A service collects a well-defined set of functions that can
be hosted on one process and accessed from another. Service requests
may be either synchronous or asynchronous.
Providing a Service
The "gk::service provider" command is used to create a new service
provider. This creates a new Tcl command named "providerName", which
is used to refer to the service provider. Details of this command are
below. The mandatory "type" parameter is used to identify the set of
requests available; all service providers of the same type should share the
same set of requests. The "handler" parameter specifies a Tcl procedure
which will respond to requests from subscribers to the service; this is
detailed below. The optional "registry" parameter indicates that the
service is to be published in the specified registry; otherwise the default
registry is used. Finally, the "name" parameter specifies the name under
which the service should be published; if omitted, the type is also used as
the name.
The Tcl command called "providerName" is used to refer to the service. It
has the following two variants:
providerName retract
providerName ?request? ?-async? request args...
The "retract" command specifies that the service is no longer available,
and should be withdrawn from the registry it is published in. The second
form allows the local process to make requests of the provider, without
file:///Paris/groupkit-5.1/doc/service.html (1 of 2) [12/10/2000 10:39:31 PM]