A number of examples are included in the Inq distribution as illustrations of how to write client-server applications.
Start here to learn about Inq client-server applications with the simplest one possible.
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.
Petstore is the blueprint application for Inq client/server. It goes much further than Chat, covering
- Advanced typedef usage
- use of construct, mutate and destroy for referential integrity and validation
- Working with databases
- primary keys
- unique, non-unique and filter lookup keys
- eligibility expressions
- capped keys
- Integrating with the environment
- JMS queue and topic usage
- Generation and parsing of XML message payloads
- Detached processes, timers and events
- A detached process, driven by a timer, acts as a spoof order processor, allocating inventory and shipping orders
- Solicitation of events in both client and server for advanced rendering and full GUI liveness
- GUI and reporting
- Advanced GUI construction including complex table rendering
- Use of Inq's built-in reusable GUI tools - the item chooser and attribute editor
- Report generation and presentation on the client
Learn about how Inq achieves all this, run it yourself or try the online version here.
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 server is scripted in some 60 services and functions totalling around 2500 lines including comments. The client is about 1200 lines. Find out about Job Control here.
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.