Example Applications
Example Applications
A number of examples are included in the Inq distribution as illustrations of how to write client-server applications.
Hello World!
Start here to learn about Inq client-server applications with the simplest one possible.
Chat
The Chat example is an instant messaging utility that supports one-to-one chat sessions, private conferences and public chat rooms. It has been written without using I/O Bindings so it runs entirely in memory. It is a good example to try first because it does not require you to set up a database server to support it. It demonstrates the following features common to Inq applications:
- The exchange of service requests between client and server;
- Building event-live structures in the server for automatic propagation and maintenance in the client;
- Login and Logout services in the server;
- GUI construction and the managing of context nodes in the client.
Many Inq applications require no further server-side cooperation than that supported by the Inq transaction model. Chat covers the interaction of User Processes to implement sending messages and managing invitations.

In the client we see how tab panes and styled text are handled.
The server is implemented in less than 1000 lines of script overall, including comments, using four typedefs. The client is a similar size. You can read more about Chat here.
Job Control
The Job Control application is a scheduler for periodic tasks. It can be loaded into a server hosting any Inq application that requires automatic task scheduling and execution
Boxes of jobs are supported so related tasks can be grouped into hierarchies, controlled together and run in a defined sequence. Each top-level job or box is run in a detached process and the scheduler itself runs in the same way. Thus, this application illustrates the Inq process control features of
- Spawning detached processes;
- Executing script fragments on process startup and termination and picking up the exit status of terminating processes.

Inq supports timers as a data type with properties to determine period or absolute execution time. Timers and the task associated with a job are expressed as Inq script and parsed by the application itself. Other aspects covered by Job Control include:
- The use of a tree-table display in the client;
- Complex table cell rendering including font styles and images
- Use of conditional lock-wait constructs to ensure mutual exclusion and stability of the job tree between the job dispatcher, spawned task and User processes in the server;
- Database blob support used to persist timer and job scripts;
- Inq's support for i/o streams using its URL syntax to associate a source/sink with a given stream format.
The Job Control is scripted in some 60 services and functions totalling around 2000 lines including comments. The client is about 1200 lines. Job Control will be added to the examples section as soon as it is written up.
User Authentication and Application Permissioning
A forthcoming application that can be used to establish authorised users of an Inq system, areas within it they may access and settings for limiting parameter values. To be added.



