removeAndTerminate

fun removeAndTerminate(task: Dispatcher.Task, waitStats: Boolean = false, afterTermination: (entity: ProcessModel.Entity) -> Unit? = null)(source)

Removes the task from the queue and terminates the process of the entity waiting on it.

For the modeller who wants outstanding transport requests abandoned rather than left hanging -- for whatever reason their model has. It is not used for end-of-replication teardown: that is done by ProcessModel.afterReplication, which terminates every suspended entity without any help from this subsystem.

Parameters

task

the task to abandon

waitStats

if true the waiting time statistics are collected. The default is false, because a wait that was abandoned rather than served is not an observation of service.

afterTermination

invoked once the process has been terminated