@@ -52,7 +52,6 @@ use crate::instance_dispatch;
52
52
use crate :: proc:: PyActorId ;
53
53
use crate :: pytokio:: PyPythonTask ;
54
54
use crate :: pytokio:: PythonTask ;
55
- use crate :: runtime:: signal_safe_block_on;
56
55
57
56
#[ derive( Clone , Debug ) ]
58
57
#[ pyclass(
@@ -146,22 +145,6 @@ impl PyMailbox {
146
145
}
147
146
}
148
147
149
- fn undeliverable_receiver < ' py > (
150
- & self ,
151
- py : Python < ' py > ,
152
- ) -> PyResult < Py < PythonUndeliverablePortReceiver > > {
153
- let ( handle, receiver) = self . inner . open_port ( ) ;
154
- handle. bind_to ( Undeliverable :: < MessageEnvelope > :: port ( ) ) ;
155
- let receiver = Py :: new (
156
- py,
157
- PythonUndeliverablePortReceiver {
158
- inner : Arc :: new ( tokio:: sync:: Mutex :: new ( receiver) ) ,
159
- } ,
160
- ) ?;
161
-
162
- Ok ( receiver)
163
- }
164
-
165
148
fn __repr__ ( & self ) -> String {
166
149
format ! ( "{:?}" , self . inner)
167
150
}
@@ -281,22 +264,6 @@ impl PythonPortHandle {
281
264
}
282
265
}
283
266
284
- #[ derive( Clone , Debug ) ]
285
- #[ pyclass(
286
- name = "UndeliverablePortHandle" ,
287
- module = "monarch._rust_bindings.monarch_hyperactor.mailbox"
288
- ) ]
289
- pub ( super ) struct PythonUndeliverablePortHandle {
290
- inner : PortHandle < Undeliverable < MessageEnvelope > > ,
291
- }
292
-
293
- #[ pymethods]
294
- impl PythonUndeliverablePortHandle {
295
- fn bind_undeliverable ( & self ) {
296
- self . inner . bind_to ( Undeliverable :: < MessageEnvelope > :: port ( ) ) ;
297
- }
298
- }
299
-
300
267
#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
301
268
#[ pyclass(
302
269
name = "PortRef" ,
@@ -437,46 +404,6 @@ impl PythonUndeliverableMessageEnvelope {
437
404
}
438
405
}
439
406
440
- #[ derive( Debug ) ]
441
- #[ pyclass(
442
- name = "UndeliverablePortReceiver" ,
443
- module = "monarch._rust_bindings.monarch_hyperactor.mailbox"
444
- ) ]
445
- pub ( super ) struct PythonUndeliverablePortReceiver {
446
- inner : Arc < tokio:: sync:: Mutex < PortReceiver < Undeliverable < MessageEnvelope > > > > ,
447
- }
448
-
449
- #[ pymethods]
450
- impl PythonUndeliverablePortReceiver {
451
- fn recv < ' py > ( & mut self , py : Python < ' py > ) -> PyResult < Bound < ' py , PyAny > > {
452
- let receiver = self . inner . clone ( ) ;
453
- crate :: runtime:: future_into_py ( py, async move {
454
- let message = receiver
455
- . lock ( )
456
- . await
457
- . recv ( )
458
- . await
459
- . map_err ( |err| PyErr :: new :: < PyEOFError , _ > ( format ! ( "Port closed: {}" , err) ) ) ?;
460
- Ok ( PythonUndeliverableMessageEnvelope {
461
- inner : Some ( message) ,
462
- } )
463
- } )
464
- }
465
-
466
- fn blocking_recv < ' py > (
467
- & mut self ,
468
- py : Python < ' py > ,
469
- ) -> PyResult < PythonUndeliverableMessageEnvelope > {
470
- let receiver = self . inner . clone ( ) ;
471
- let message = signal_safe_block_on ( py, async move { receiver. lock ( ) . await . recv ( ) . await } ) ?
472
- . map_err ( |err| PyErr :: new :: < PyEOFError , _ > ( format ! ( "Port closed: {}" , err) ) ) ?;
473
-
474
- Ok ( PythonUndeliverableMessageEnvelope {
475
- inner : Some ( message) ,
476
- } )
477
- }
478
- }
479
-
480
407
#[ derive( Debug ) ]
481
408
#[ pyclass(
482
409
name = "OncePortHandle" ,
@@ -728,10 +655,8 @@ pub fn register_python_bindings(hyperactor_mod: &Bound<'_, PyModule>) -> PyResul
728
655
hyperactor_mod. add_class :: < PyMailbox > ( ) ?;
729
656
hyperactor_mod. add_class :: < PyPortId > ( ) ?;
730
657
hyperactor_mod. add_class :: < PythonPortHandle > ( ) ?;
731
- hyperactor_mod. add_class :: < PythonUndeliverablePortHandle > ( ) ?;
732
658
hyperactor_mod. add_class :: < PythonPortRef > ( ) ?;
733
659
hyperactor_mod. add_class :: < PythonPortReceiver > ( ) ?;
734
- hyperactor_mod. add_class :: < PythonUndeliverablePortReceiver > ( ) ?;
735
660
hyperactor_mod. add_class :: < PythonOncePortHandle > ( ) ?;
736
661
hyperactor_mod. add_class :: < PythonOncePortRef > ( ) ?;
737
662
hyperactor_mod. add_class :: < PythonOncePortReceiver > ( ) ?;
0 commit comments