2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  io.timeouts 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-21 20:12:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								USING:  help.markup  help.syntax  math  kernel  calendar  ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-21 20:12:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  timeout 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-16 07:02:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } { "dt/f"  { $maybe duration } } }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-21 20:12:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $contract "Outputs an object's timeout."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  set-timeout 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-16 07:02:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "dt/f"  { $maybe duration } } { "obj"  object  } }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-21 20:12:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $contract "Sets an object's timeout."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-05-21 02:36:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cancel-operation 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $contract "Handles a timeout, usually by waking up all threads waiting on the object."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  with-timeout 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-16 10:03:30 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } { "quot"  { $quotation "( obj -- )"  } } }
							 
						 
					
						
							
								
									
										
										
										
											2008-05-21 02:36:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Applies the quotation to the object. If the object's timeout expires before the quotation returns, "  { $link cancel-operation } " is called on the object."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "io.timeouts"  "I/O timeout protocol" 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-11 08:15:26 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Streams, processes and monitors support optional timeouts, which impose an upper bound on the length of time for which an operation on these objects can block. Timeouts are used in network servers to prevent malicious clients from holding onto connections forever, and to ensure that runaway processes get killed." 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-21 20:12:55 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection timeout }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection set-timeout }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"The I/O timeout protocol can be implemented by any class wishing to support timeouts on blocking operations." 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-21 02:36:30 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection cancel-operation }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"A combinator to be used in operations which can time out:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection with-timeout }
							 
						 
					
						
							
								
									
										
										
										
											2008-04-11 08:15:26 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also "stream-protocol"  "io.launcher"  "io.monitors"  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-09 23:28:22 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "io.timeouts"