GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    ロージー / ハト (rosylilly@best-friends.chat)'s status on Saturday, 30-Mar-2024 12:59:12 JSTロージー / ハトロージー / ハト
    in reply to
    • 斎藤ただし
    • かき@GNUsocialJP

    @tadd ちょっと書くと……

    async / await

    function main() {
    const waiter = asyncF();
    ...
    const needValue = await waiter();
    }

    ↑ 素直に asyncF で生成した Promise の値が欲しくなったら await で待つ

    goroutine

    func main() {
    receiver := make(chan val)

    go func() {
    receiver <- heavyLoad();
    }()

    select {
    case needValue := <-receiver:
    }
    }

    ↑ チャンネル作ってそれを関数なり goroutine に渡して send してもらって recv の待ち合わせを書く、みたいなだるさ

    In conversationabout a year ago from best-friends.chatpermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.