Sha256: 15206ff3211aac67015f43eb6ee573a86150280f51fcbcae90e3f993b88c2b46
Contents?: true
Size: 685 Bytes
Versions: 6
Compression:
Stored size: 685 Bytes
Contents
# frozen_string_literal: true module AnyCable module Middlewares # Checks that RPC client version is compatible with # the current RPC proto version class CheckVersion < Middleware attr_reader :version def initialize(version) @version = version end def call(_request, call, _method) supported_versions = call.metadata["protov"]&.split(",") return yield if supported_versions&.include?(version) raise GRPC::Internal, "Incompatible AnyCable RPC client.\nCurrent server version: #{version}.\n" \ "Client supported versions: #{call.metadata["protov"] || "unknown"}." end end end end
Version data entries
6 entries across 6 versions & 1 rubygems