@@ -21,8 +21,9 @@ use crate::{
2121 macros:: { build, import, option_wrapper, py_static, try_import, wrapper} ,
2222 pubsub:: Subscriber ,
2323 qos:: { CongestionControl , Priority , Reliability } ,
24- sample:: Sample ,
24+ sample:: { Locality , Sample } ,
2525 session:: { EntityGlobalId , Session } ,
26+ time:: Timestamp ,
2627 utils:: { duration, generic, wait, MapInto } ,
2728 ZDeserializeError ,
2829} ;
@@ -481,26 +482,30 @@ impl AdvancedPublisher {
481482 Ok ( self . get_ref ( ) ?. priority ( ) . into ( ) )
482483 }
483484
484- // TODO add timestamp
485- #[ pyo3( signature = ( payload, * , encoding = None , attachment = None ) ) ]
485+ #[ pyo3( signature = ( payload, * , encoding = None , attachment = None , timestamp = None ) ) ]
486486 fn put (
487487 & self ,
488488 py : Python ,
489489 #[ pyo3( from_py_with = "ZBytes::from_py" ) ] payload : ZBytes ,
490490 #[ pyo3( from_py_with = "Encoding::from_py_opt" ) ] encoding : Option < Encoding > ,
491491 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] attachment : Option < ZBytes > ,
492+ timestamp : Option < Timestamp > ,
492493 ) -> PyResult < ( ) > {
493494 let this = self . get_ref ( ) ?;
494- wait ( py, build ! ( this. put( payload) , encoding, attachment) )
495+ wait (
496+ py,
497+ build ! ( this. put( payload) , encoding, attachment, timestamp) ,
498+ )
495499 }
496500
497- #[ pyo3( signature = ( * , attachment = None ) ) ]
501+ #[ pyo3( signature = ( * , attachment = None , timestamp = None ) ) ]
498502 fn delete (
499503 & self ,
500504 py : Python ,
501505 #[ pyo3( from_py_with = "ZBytes::from_py_opt" ) ] attachment : Option < ZBytes > ,
506+ timestamp : Option < Timestamp > ,
502507 ) -> PyResult < ( ) > {
503- wait ( py, build ! ( self . get_ref( ) ?. delete( ) , attachment) )
508+ wait ( py, build ! ( self . get_ref( ) ?. delete( ) , attachment, timestamp ) )
504509 }
505510
506511 fn undeclare ( & mut self , py : Python ) -> PyResult < ( ) > {
@@ -743,7 +748,7 @@ impl SampleMissListener {
743748
744749#[ allow( clippy:: too_many_arguments) ]
745750#[ pyfunction]
746- #[ pyo3( signature = ( session, key_expr, * , encoding = None , congestion_control = None , priority = None , express = None , reliability = None , cache = None , sample_miss_detection = None , publisher_detection = None ) ) ]
751+ #[ pyo3( signature = ( session, key_expr, * , encoding = None , congestion_control = None , priority = None , express = None , reliability = None , allowed_destination = None , cache = None , sample_miss_detection = None , publisher_detection = None ) ) ]
747752pub ( crate ) fn declare_advanced_publisher (
748753 py : Python ,
749754 session : & Session ,
@@ -753,6 +758,7 @@ pub(crate) fn declare_advanced_publisher(
753758 priority : Option < Priority > ,
754759 express : Option < bool > ,
755760 reliability : Option < Reliability > ,
761+ allowed_destination : Option < Locality > ,
756762 cache : Option < CacheConfig > ,
757763 sample_miss_detection : Option < MissDetectionConfig > ,
758764 publisher_detection : Option < bool > ,
@@ -764,6 +770,7 @@ pub(crate) fn declare_advanced_publisher(
764770 priority,
765771 express,
766772 reliability,
773+ allowed_destination,
767774 cache,
768775 sample_miss_detection,
769776 ) ;
@@ -775,19 +782,21 @@ pub(crate) fn declare_advanced_publisher(
775782
776783#[ allow( clippy:: too_many_arguments) ]
777784#[ pyfunction]
778- #[ pyo3( signature = ( session, key_expr, handler = None , * , history = None , recovery = None , subscriber_detection = None ) ) ]
785+ #[ pyo3( signature = ( session, key_expr, handler = None , * , allowed_origin = None , history = None , recovery = None , subscriber_detection = None ) ) ]
779786pub ( crate ) fn declare_advanced_subscriber (
780787 session : & Session ,
781788 py : Python ,
782789 #[ pyo3( from_py_with = "KeyExpr::from_py" ) ] key_expr : KeyExpr ,
783790 handler : Option < & Bound < PyAny > > ,
791+ allowed_origin : Option < Locality > ,
784792 history : Option < HistoryConfig > ,
785793 recovery : Option < RecoveryConfig > ,
786794 subscriber_detection : Option < bool > ,
787795) -> PyResult < AdvancedSubscriber > {
788796 let ( handler, background) = into_handler ( py, handler) ?;
789797 let mut builder = build ! (
790798 session. 0 . declare_subscriber( key_expr) . advanced( ) ,
799+ allowed_origin,
791800 history,
792801 recovery
793802 ) ;
0 commit comments