<commit_before>import grpc from 'grpc'

// Import service methods
import Ping from './Ping'
import ReadAggregateStreamForwardFromCursor from './ReadAggregateStreamForwardFromCursor'
import ReadAggregateTypeStreamForward from './ReadAggregateTypeStreamForward'
import ReadEventTypeStreamForward from './ReadEventTypeStreamForward'
import ReadStoreStreamForward from './ReadStoreStreamForward'
import SubscribeToAggregateStream from './SubscribeToAggregateStream'
import SubscribeToAggregateStreamFromCursor from './SubscribeToAggregateStreamFromCursor'
import SubscribeToAggregateTypeStream from './SubscribeToAggregateTypeStream'
import SubscribeToAggregateTypeStreamFrom from './SubscribeToAggregateTypeStreamFrom'
import SubscribeToEventTypeStream from './SubscribeToEventTypeStream'
import SubscribeToEventTypeStreamFrom from './SubscribeToEventTypeStreamFrom'
import SubscribeToStoreStream from './SubscribeToStoreStream'
import SubscribeToStoreStreamFromCursor from './SubscribeToStoreStreamFromCursor'
import WriteToAggregateStream from './WriteToAggregateStream'
import WriteToMultipleAggregateStream from './WriteToMultipleAggregateStream'

const PROTOCOL_FILE_PATH = `${__dirname}/../../gRPCEventStore.proto`

function getGRPCServer () {
  const gRPCEventStoreProtocol = grpc.load(PROTOCOL_FILE_PATH).gRPCEventStore
  const _grpcServer = new grpc.Server()
  _grpcServer.addProtoService(gRPCEventStoreProtocol.Api.service, {
    ping: Ping(),
    readAggregateStreamForwardFromCursor: ReadAggregateStreamForwardFromCursor(),
    readAggregateTypeStreamForward: ReadAggregateTypeStreamForward(),
    readEventTypeStreamForward: ReadEventTypeStreamForward(),
    readStoreStreamForward: ReadStoreStreamForward(),
    subscribeToAggregateStream: SubscribeToAggregateStream(),
    subscribeToAggregateStreamFromCursor: SubscribeToAggregateStreamFromCursor(),
    subscribeToAggregateTypeStream: SubscribeToAggregateTypeStream(),
    subscribeToAggregateTypeStreamFrom: SubscribeToAggregateTypeStreamFrom(),
    subscribeToEventTypeStream: SubscribeToEventTypeStream(),
    subscribeToEventTypeStreamFrom: SubscribeToEventTypeStreamFrom(),
    subscribeToStoreStream: SubscribeToStoreStream(),
    subscribeToStoreStreamFromCursor: SubscribeToStoreStreamFromCursor(),
    writeToAggregateStream: WriteToAggregateStream(),
    writeToMultipleAggregateStream: WriteToMultipleAggregateStream()
  })
}

export default getGRPCServer<commit_msg>passing an eventStore({backend, cluster}) interface to gRPC implementation<commit_after>import grpc from 'grpc'

// Import service methods
import Ping from './Ping'
import ReadAggregateStreamForwardFromCursor from './ReadAggregateStreamForwardFromCursor'
import ReadAggregateTypeStreamForward from './ReadAggregateTypeStreamForward'
import ReadEventTypeStreamForward from './ReadEventTypeStreamForward'
import ReadStoreStreamForward from './ReadStoreStreamForward'
import SubscribeToAggregateStream from './SubscribeToAggregateStream'
import SubscribeToAggregateStreamFromCursor from './SubscribeToAggregateStreamFromCursor'
import SubscribeToAggregateTypeStream from './SubscribeToAggregateTypeStream'
import SubscribeToAggregateTypeStreamFrom from './SubscribeToAggregateTypeStreamFrom'
import SubscribeToEventTypeStream from './SubscribeToEventTypeStream'
import SubscribeToEventTypeStreamFrom from './SubscribeToEventTypeStreamFrom'
import SubscribeToStoreStream from './SubscribeToStoreStream'
import SubscribeToStoreStreamFromCursor from './SubscribeToStoreStreamFromCursor'
import WriteToAggregateStream from './WriteToAggregateStream'
import WriteToMultipleAggregateStream from './WriteToMultipleAggregateStream'

const PROTOCOL_FILE_PATH = `${__dirname}/../../gRPCEventStore.proto`

function createGRPCServer (eventStore) {
  const gRPCEventStoreProtocol = grpc.load(PROTOCOL_FILE_PATH).gRPCEventStore
  const _grpcServer = new grpc.Server()
  _grpcServer.addProtoService(gRPCEventStoreProtocol.Api.service, {
    ping: Ping(eventStore),
    readAggregateStreamForwardFromCursor: ReadAggregateStreamForwardFromCursor(eventStore),
    readAggregateTypeStreamForward: ReadAggregateTypeStreamForward(eventStore),
    readEventTypeStreamForward: ReadEventTypeStreamForward(eventStore),
    readStoreStreamForward: ReadStoreStreamForward(eventStore),
    subscribeToAggregateStream: SubscribeToAggregateStream(eventStore),
    subscribeToAggregateStreamFromCursor: SubscribeToAggregateStreamFromCursor(eventStore),
    subscribeToAggregateTypeStream: SubscribeToAggregateTypeStream(eventStore),
    subscribeToAggregateTypeStreamFrom: SubscribeToAggregateTypeStreamFrom(eventStore),
    subscribeToEventTypeStream: SubscribeToEventTypeStream(eventStore),
    subscribeToEventTypeStreamFrom: SubscribeToEventTypeStreamFrom(eventStore),
    subscribeToStoreStream: SubscribeToStoreStream(eventStore),
    subscribeToStoreStreamFromCursor: SubscribeToStoreStreamFromCursor(eventStore),
    writeToAggregateStream: WriteToAggregateStream(eventStore),
    writeToMultipleAggregateStream: WriteToMultipleAggregateStream(eventStore)
  })
}

export default createGRPCServer
{'fraction_non_alphanumeric': 0.06397965173155938, 'fraction_numerical': 0.0, 'mean_word_length': 9.518518518518519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '235673', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1344, 'n_words': 233}