Skip to content

Commit

Permalink
Rename synchronous Rate_limiter to Synchronous_rate_limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
leviroth committed Jan 26, 2024
1 parent 4884d49 commit f283126
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions reddit_api_async/connection.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open! Core
open! Async
module Rate_limiter' = Rate_limiter
open Reddit_api_kernel
module Rate_limiter = Rate_limiter'

module Credentials = struct
module Password = struct
Expand Down Expand Up @@ -385,7 +383,6 @@ type t = T : (module T with type t = 't) * 't -> t
let sexp_of_t (T ((module T), t)) = T.sexp_of_t t

let all_rate_limiters () =
let module Synchronous_rate_limiter = Reddit_api_kernel.Rate_limiter in
Synchronous_rate_limiter.combine
[ Synchronous_rate_limiter.by_headers
; Synchronous_rate_limiter.with_minimum_delay ~delay:(Time_ns.Span.of_int_ms 100)
Expand Down
2 changes: 1 addition & 1 deletion reddit_api_async/rate_limiter.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open! Core
open! Async
module Synchronous_rate_limiter = Reddit_api_kernel.Rate_limiter
module Synchronous_rate_limiter = Reddit_api_kernel.Synchronous_rate_limiter

type t =
{ mutable state : Synchronous_rate_limiter.t
Expand Down
2 changes: 1 addition & 1 deletion reddit_api_async/rate_limiter.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ open! Async

type t [@@deriving sexp_of]

val of_synchronous : Reddit_api_kernel.Rate_limiter.t -> Time_source.t -> t
val of_synchronous : Reddit_api_kernel.Synchronous_rate_limiter.t -> Time_source.t -> t
val permit_request : t -> unit Deferred.t
val notify_response : t -> Cohttp.Response.t -> unit
val is_ready : t -> bool
Expand Down
2 changes: 1 addition & 1 deletion reddit_api_kernel/reddit_api_kernel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ module Listing = Listing
module Mod_action = Mod_action
module Moderator_report = Moderator_report
module Modmail = Modmail
module Rate_limiter = Rate_limiter
module Relationship = Relationship
module Stylesheet = Stylesheet
module Submit_text = Submit_text
module Subreddit_name = Subreddit_name
module Subreddit_rules = Subreddit_rules
module Subreddit_settings = Subreddit_settings
module Subreddit_traffic = Subreddit_traffic
module Synchronous_rate_limiter = Synchronous_rate_limiter
module Thing = Thing
module Thing_kind = Thing_kind
module Uri_with_string_sexp = Uri_with_string_sexp
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test_rate_limiter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let%expect_test _ =
let time_source = Time_source.create ~now:(00 ^: 00) () in
let rate_limiter =
Reddit_api_async.Rate_limiter.of_synchronous
Reddit_api_kernel.Rate_limiter.by_headers
Reddit_api_kernel.Synchronous_rate_limiter.by_headers
(Time_source.read_only time_source)
in
let print () =
Expand Down

0 comments on commit f283126

Please sign in to comment.