class SOCKET_SERVER_JOB

Features exported to LOOP_ITEM

Encapsulate the server in a sequencer-aware job.

Direct parents

conformant parents

JOB

Summary

creation features

exported features

The following features are inherited from JOB:

Details

make (a_server: SOCKET_SERVER)
when_connect (handler: PROCEDURE [O_ -> TUPLE][TUPLE 1 [A_][SOCKET_INPUT_OUTPUT_STREAM]])

What to do when connection happens (i.e. some client tries to connect to the server). The procedure is given the stream connected to the client.

require

  • not done

when_shutdown (handler: PROCEDURE [O_ -> TUPLE][TUPLE 1 [A_][SOCKET_SERVER_JOB]])

Should be more accurately be called when_shutdown_or_halt. The agent is called when a shutdown or a halt of the server occurs.

require

  • not done

shutdown

Wait for the connections to finish, then stop the server. No more connections will be accepted.

require

  • not done

ensure

  • done

halt

require

  • not done

ensure

  • done

done: BOOLEAN

done returns True when the job is finished. Then the job may be restart(ed) if it need to run again.

prepare (ready: READY_DESCRIPTION)

use ready to descibe condition that make this job ready to continue.

require

  • ready /= Void
  • not ready.queryable

is_ready (ready: READY_DESCRIPTION): BOOLEAN

check if this job is ready to continue his work

require

  • ready /= Void
  • ready.queryable

continue

Continue to do the job The work to do has to be small work and non blocking, it will continue on next call

restart

Configure the job like the initial state. Example: when some window dialog appears second time, all jobs from this window are restarted.

require

  • done

ensure

  • not done

priority: INTEGER

Never change priority after job inserted in loop_item. Priority should only be set at creation time.

< (other: JOB): BOOLEAN

Class invariant