.\" ----------
.\" figure-2
.\"
.\"	Copyright (c) 2003-2009, PostgreSQL Global Development Group
.\"	Author: Jan Wieck, Afilias USA INC.
.\"
.\" 
.\" ----------
.PS
.ps -2
.vs 1m
Outer:	box wid 5.2 ht 2.8
		"Figure 2" at Outer.s below

define FileSymbol {
	ellipse wid 0.8 ht 0.25
	box wid 0.8 ht 0.2 invisible fill 0.0 with .s at last ellipse .c
	ellipse same with .c at last ellipse .c+(0.0,0.8)
	line from last box .sw to last ellipse .w
	line from last box .se to last ellipse .e
}

DB1:	[ FileSymbol() ] with .w at Outer.w+(0.2,0.0)
		"Local" "DB" with .c at DB1.c-(0.0,0.1)

DB2:	[ FileSymbol() ] with .e at Outer.e-(0.2,0.0)
		"Remote" "DB" with .c at DB2.c-(0.0,0.1)

T_LS:	box wid 1.2 ht 0.2 with .n at Outer.n-(0.0,0.2) "Sync Thread"
		arrow from T_LS.w left 1.0
.ps -4
		"SYNC" at last arrow .c below
.ps +4

T_LC:	box wid 1.2 ht 0.2 with .n at T_LS.s-(0.0,0.2) "Cleanup Thread"
		arrow from T_LC.w left 1.0
.ps -4
		"CleanUp" at last arrow .c below
.ps +4

T_LL:	box wid 1.2 ht 0.2 with .n at T_LC.s-(0.0,0.2) "Local Listen"
		line <-> from T_LL.w left 1.0
.ps -4
		"Notify, Event" at last line .c above
		"Confirm" at last line .c below
.ps +4

T_RL:	box wid 1.2 ht 0.5 with .n at T_LL.s-(0.0,0.2) "Remote Listen" "1 thread per" "event provider"
		line <- from T_RL.e right 1.0
.ps -4
		"Notify, Event" at last line .c above
.ps +4

T_RW:	box wid 1.2 ht 0.5 with .n at T_RL.s-(0.0,0.2) "Remote Worker" "1 thread per" "remote node"
		line <-> from T_RW.e right 1.0
.ps -4
		"Data" at last line .c above
		"Confirm" at last line .c below
.ps +4
		line -> from T_RW.w left 1.0
.ps -4
		"Event, Data, Confirm" at last line .c below
.ps +4

		spline -> from T_RL.w-(0.0,0.0) left 0.6 to T_RW.w+(0.0,0.05)
.ps -4
		"Event " at T_RL.w-(0.0,0.1) rjust below
.ps +4

.ps +2
.vs
.PE
