Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 89
    • Merge requests 89
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • pleromapleroma
  • Merge requests
  • !3440

Recompilation speedup: create Dynamic client for ReverseProxy

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alex Gleason requested to merge cycles-reverse-proxy into develop Jun 02, 2021
  • Overview 5
  • Commits 2
  • Pipelines 2
  • Changes 3

#2651 (closed)

ReverseProxy can have a configurable HTTP client. The choices are Hackney and Tesla.

Those clients use @behaviour Pleroma.ReverseProxy.Client. However, Pleroma.ReverseProxy.Client also contains functions, resulting in compile-time cycles.

After thinking about this harder, I realized the code in ReverseProxy.Client is a Client itself. It dynamically chooses either Hackney or Tesla based on the user's config.

In light of this, I moved the code into ReverseProxy.Client.Dynamic. Now ReverseProxy.Client is strictly a behaviour with no other deps. It removes a cycle and reduces 3 others: https://www.diffchecker.com/lA3gMLyO

Screenshot_from_2021-06-02_16-17-05

I'm pretty happy with this one because I think it's a code quality improvement in addition to speeding up recompilation.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cycles-reverse-proxy