Skip to content

Calling peripheral.wrap on an inventory and calling the list method in a coroutine seems to have an odd behaviour #1253

Answered by SquidDev
Shiranuit asked this question in Q&A
Discussion options

You must be logged in to vote

TLDR: Peripheral functions should be treated as a black box, like any like other user provided function. The events they pull, and what those events contain, isn't part of the public API, and so isn't guaranteed to be stable.

When the call to list() occurs it yield with task_complete but does not give a task_id which means if there are multiple task_complete event we cannot know which result belong to our coroutine

When a function/program/coroutine pulls an event, it doesn't contain anything aside from the event name (in the same way that http.get just pulls the http_* events, rather than http_* and a URL).

Resuming the coroutine after that doesn't do anything, even though there is sti…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Shiranuit
Comment options

Answer selected by Shiranuit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1252 on December 15, 2022 19:14.