File tree Expand file tree Collapse file tree 5 files changed +40
-7
lines changed
Expand file tree Collapse file tree 5 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ Versioning <https://semver.org/spec/v2.0.0.html>`_.
1010Unreleased _
1111-----------
1212
13+ Added:
14+
15+ - `Caput with callback <../../pull/98 >`_
16+
1317Fixed:
1418
1519- `Passing a custom asyncio event loop into the AsyncioDispatcher causes methods to never run <../../pull/96 >`_
Original file line number Diff line number Diff line change @@ -228,6 +228,23 @@ Test Facilities`_ documentation for more details of each function.
228228 which don't change its value will be discarded. In particular this means
229229 that such updates don't call `validate ` or `on_update `.
230230
231+ .. _blocking :
232+
233+ `blocking `
234+ ~~~~~~~~~~
235+
236+ Only available on OUT records. When set to `True ` the record will set the
237+ ``PACT `` field when processing is ongoing. This means that ``caput `` and
238+ similar tools can correctly wait for processing to complete.
239+
240+ This flag defaults to `False `, to retain compatibility with previous
241+ versions.
242+
243+ .. seealso ::
244+ `SetBlocking ` for configuring a global default blocking value
245+
246+
247+
231248For all of these functions any EPICS database field can be assigned a value by
232249passing it as a keyword argument for the corresponding field name (in upper
233250case) or by assigning to the corresponding field of the returned record object.
@@ -358,6 +375,17 @@ record creation function.
358375 prevent the accidential creation of records with the currently set device
359376 name.
360377
378+ .. function :: SetBlocking(blocking)
379+
380+ This can be used to globally set the default `blocking ` flag, which will
381+ apply to all records created after this point. This allows blocking to be
382+ easily set/unset when creating groups of records.
383+
384+ This does not change the blocking value for any already created records.
385+
386+ .. seealso ::
387+ `blocking ` for description of the flag
388+
361389
362390The following helper functions are useful when constructing links between
363391records.
Original file line number Diff line number Diff line change 99
1010from . import device , pythonSoftIoc # noqa
1111# Re-export this so users only have to import the builder
12- from .device import set_blocking # noqa
12+ from .device import SetBlocking # noqa
1313
1414PythonDevice = pythonSoftIoc .PythonDevice ()
1515
@@ -305,5 +305,5 @@ def UnsetDevice():
305305 'LoadDatabase' ,
306306 'SetDeviceName' , 'UnsetDevice' ,
307307 # Device support functions
308- 'set_blocking '
308+ 'SetBlocking '
309309]
Original file line number Diff line number Diff line change 2727# Default False to maintain behaviour from previous versions.
2828blocking = False
2929
30- # TODO: Docs and Tests for the Blocking feature
31- def set_blocking (val ):
30+ def SetBlocking (val ):
3231 global blocking
3332 blocking = val
3433
Original file line number Diff line number Diff line change 1616)
1717
1818from softioc import asyncio_dispatcher , builder , softioc
19- from softioc .device import set_blocking
19+ from softioc .device import SetBlocking
2020
2121# Test file for miscellaneous tests related to records
2222
@@ -185,6 +185,7 @@ def test_pini_always_on():
185185def validate_fixture_names (params ):
186186 """Provide nice names for the out_records fixture in TestValidate class"""
187187 return params [0 ].__name__
188+
188189class TestValidate :
189190 """Tests related to the validate callback"""
190191
@@ -524,11 +525,11 @@ def test_blocking_creates_attributes(self):
524525
525526 def test_blocking_global_flag_creates_attributes (self ):
526527 """Test that the global blocking flag creates the expected attributes"""
527- set_blocking (True )
528+ SetBlocking (True )
528529 bo1 = builder .boolOut ("OUTREC1" )
529530 self .check_record_blocking_attributes (bo1 )
530531
531- set_blocking (False )
532+ SetBlocking (False )
532533 bo2 = builder .boolOut ("OUTREC2" )
533534 assert bo2 ._blocking is False
534535
@@ -576,6 +577,7 @@ async def blocking_update_func(new_val):
576577
577578 log ("CHILD: Received exit command, child exiting" )
578579
580+ @requires_cothread
579581 def test_blocking_single_thread_multiple_calls (self ):
580582 """Test that a blocking record correctly causes multiple caputs from
581583 a single thread to wait for the expected time"""
You can’t perform that action at this time.
0 commit comments