Object ::xo::mr::bgdelivery (public)
::xo::MessageRelay ::xo::mr::bgdelivery
Defined in packages/xotcl-core/tcl/message-relay-procs.tcl
Message relay based on bgdelivery
- Testcases:
- No testcase defined.
Source code: :public object method subscribe {key {-initmsg ""} {-mode default} } { # # Subscribe to a messaging service using bgdelivery as the low # level transport. # ns_log notice "#### [self] subscribe <$key> mode <$mode>" set ch [ns_conn channel] thread::transfer [::bgdelivery get_tid] $ch # ::bgdelivery do ::Subscriber sweep $key ::bgdelivery do ::Subscriber new -channel $ch -key $key -user_id [ad_conn user_id] -mode $mode -start_of_page [:start_of_page $mode] } :public object method send_to_subscriber {key msg} { # # Send a message to the subscriber via bgdelivery # ns_log notice "#### [self] send_to_subscriber $key $msg" ::bgdelivery do -async ::Subscriber broadcast $key $msg } :public object method can_be_used {} { # # To use the bgdelivery serive, we require support from the web # server, an installed bgdelivery. This method does not work on # HTTPS, since this method writes to the raw sockets. # return [expr { [info commands ::thread::mutex] ne "" && [info commands ::bgdelivery] ne "" && (![ns_conn isconnected] || ![security::secure_conn_p]) }] } :public object method sweep {key} { # # Clean up messages for this key. This should handle potentially # stale operations. # ::bgdelivery do ::Subscriber sweep $key }XQL Not present: Generic, PostgreSQL, Oracle