Typeberry by Fluffy Labs - v0.5.0
    Preparing search index...

    Class DirectPort

    A message-passing port that is directly connected to another end.

    Direct connection means, that both tx and rx exist in the same worker thread, so there is no need for any serialization - we simply pass the data.

    Implements

    Index

    Properties

    threadId: 0

    Optional thread id.

    Methods

    • Attach event listener for particular event.

      Returns a function that can be called to unsubscribe.

      Type Parameters

      • T

      Parameters

      Returns () => void

    • Attach one-time event listener for particular event.

      Returns a function that can be called to unsubscribe.

      Type Parameters

      • T

      Parameters

      Returns () => void

    • Attach a callback to be triggered when the port is being closed (via error or not).

      Parameters

      • callback: (e: Error) => void

      Returns void