- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Message relay based on bgdelivery
Class Relations
::xo::MessageRelay create ::xo::mr::bgdelivery
Methods (to be applied on the object)
can_be_used (scripted, public)
xo::mr::bgdelivery 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.
- Testcases:
- No testcase defined.
# # 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]) }]
send_to_subscriber (scripted, public)
xo::mr::bgdelivery send_to_subscriber key msg
Send a message to the subscriber via bgdelivery
- Parameters:
- key (required)
- msg (required)
- Testcases:
- No testcase defined.
# # Send a message to the subscriber via bgdelivery # ns_log notice "#### [self] send_to_subscriber $key $msg" ::bgdelivery do -async ::Subscriber broadcast $key $msg
subscribe (scripted, public)
xo::mr::bgdelivery subscribe [ -initmsg initmsg ] [ -mode mode ] key
Subscribe to a messaging service using bgdelivery as the low level transport.
- Switches:
- -initmsg (optional)
- -mode (optional, defaults to
"default"
)
- Parameters:
- key (required)
- Testcases:
- No testcase defined.
# # 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]
sweep (scripted, public)
xo::mr::bgdelivery sweep key
Clean up messages for this key. This should handle potentially stale operations.
- Parameters:
- key (required)
- Testcases:
- No testcase defined.
# # Clean up messages for this key. This should handle potentially # stale operations. # ::bgdelivery do ::Subscriber sweep $key
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables