Skip to content

Commit

Permalink
refactor: add lazy field to LibraryCollectionData
Browse files Browse the repository at this point in the history
This is required to handle the signal asynchronously whenever the sender
does not care about the handler execution completion.

For example, whenever multiple collections are updated due to a
component being added or removed, we do not want to wait for all
collection update handlers to complete.
  • Loading branch information
navinkarkera committed Oct 10, 2024
1 parent f7c8695 commit 9a67020
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions openedx_events/content_authoring/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ class LibraryCollectionData:
Arguments:
library_key (LibraryLocatorV2): a key that represents a Blockstore-based content library.
collection_key (str): identifies the collection within the library's learning package
lazy (bool): indicate whether the sender doesn't want to wait for handler to finish execution,
i.e., the handler can run the task in background. By default it is False.
"""

library_key = attr.ib(type=LibraryLocatorV2)
collection_key = attr.ib(type=str)
lazy = attr.ib(type=bool, default=False)
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
{
"name": "collection_key",
"type": "string"
},
{
"name": "lazy",
"type": "boolean"
}
]
}
}
],
"namespace": "org.openedx.content_authoring.content_library.collection.created.v1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
{
"name": "collection_key",
"type": "string"
},
{
"name": "lazy",
"type": "boolean"
}
]
}
}
],
"namespace": "org.openedx.content_authoring.content_library.collection.deleted.v1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
{
"name": "collection_key",
"type": "string"
},
{
"name": "lazy",
"type": "boolean"
}
]
}
}
],
"namespace": "org.openedx.content_authoring.content_library.collection.updated.v1"
}
}

0 comments on commit 9a67020

Please sign in to comment.