Clworld

MastodonのToot時処理フロー

May 2nd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. ※perform_asyncの箇所でSidekiqを経由する
  2.  
  3. /api/v1/statuses/create
  4. PostStatusService.new.call
  5. ProcessMentionsService.new.call → (a)
  6. ProcessHashtagsService.new.call → タグとnsfwをパースしてstatusesへ設定
  7. LinkCrawlWorker.perform_async → FetchLinkCardService.new.call → OEmbed, OpenGraph処理
  8. DistributionWorker.perform_async → (b)
  9. Pubsubhubbub::DistributionWorker.perform_async → (c)
  10.  
  11. (a) ProcessMentionsService.new.call
  12. ↓×mention数
  13. リモートのユーザでローカルにアカウント情報がまだ無い場合: FollowRemoteAccountService.new.call
  14. ローカルの場合: NotifyService.new.call → Redis.current.publish, InlineRenderer.render(@notification, @recipient, 'api/v1/notifications/show')
  15. リモートの場合: NotificationWorker.perform_async → SendInteractionService.new.call → OStatus2::Salmon.new.post
  16.  
  17. (b) DistributionWorker.perform_async
  18. FanOutOnWriteService.new.call
  19. FeedManager.instance.push ×1 → (d)
  20. FeedInsertWorker.perform_async ×ローカルフォロワー数 → FeedManager.instance.push → (d)
  21. InlineRenderer.render(status, nil, 'api/v1/statuses/show') ×1
  22. Redis.current.publish ×ハッシュタグ数+LTL+FTL
  23.  
  24. (d) FeedManager.instance.push(この時点で×1+ローカルフォロワー数)
  25. PushUpdateWorker.perform_async
  26. InlineRenderer.render(status, account, 'api/v1/statuses/show')
  27. Redis.current.publish
  28.  
  29. (c) Pubsubhubbub::DistributionWorker.perform_async
  30. ↓ ×リモートフォロワーが居るサーバ数
  31. Pubsubhubbub::DeliveryWorker.perform_async → HTTP.post → 相手サーバへ
Advertisement
Add Comment
Please, Sign In to add comment