Example #1
0
        /// <summary>
        /// This is the main entry point for your service instance.
        /// </summary>
        /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service instance.</param>
        protected override async Task RunAsync(CancellationToken cancellationToken)
        {
            // TODO: Replace the following sample code with your own logic
            //       or remove this RunAsync override if it's not needed in your service.

            long iterations = 0;

            while (true)
            {
                cancellationToken.ThrowIfCancellationRequested();

                m_TripleStoreMemoryCloudClient.Ping();

                var messageResponse = m_TripleStoreMemoryCloudClient.HelloMessage(new HelloNessageRequestWriter($"Hello from GE/SF Remoting Client"));

                Log.WriteLine($"Working");

                var storeTripleRequest =
                    new StoreTripleRequestWriter()
                {
                    Subject   = @"GraphEngine",
                    Predicate = @"IsA",
                    Object    = @"GraphDataManagementSystem"
                };

                ServiceEventSource.Current.ServiceMessage(this.Context, "Working-{0}", ++iterations);

                //var tripleResponse = m_TripleStoreMemoryCloudClient.StoreTriple(storeTripleRequest);

                await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false);
            }
        }
Example #2
0
        /// <summary>
        /// This is the main entry point for your service instance.
        /// </summary>
        /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service instance.</param>
        protected override async Task RunAsync(CancellationToken cancellationToken)
        {
            // TODO: Replace the following sample code with your own logic
            //       or remove this RunAsync override if it's not needed in your service.

            long iterations = 0;

            while (true)
            {
                cancellationToken.ThrowIfCancellationRequested();

                ServiceEventSource.Current.ServiceMessage(this.Context, "Working-{0}", ++iterations);

                m_trinity?.Ping();

                await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
            }
        }
        /// <summary>
        /// This is the main entry point for your service instance.
        /// </summary>
        /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service instance.</param>
        protected override async Task RunAsync(CancellationToken cancellationToken)
        {
            // TODO: Replace the following sample code with your own logic
            //       or remove this RunAsync override if it's not needed in your service.

            long iterations = 0;

            while (true)
            {
                cancellationToken.ThrowIfCancellationRequested();

                ServiceEventSource.Current.ServiceMessage(this.Context, "GraphEngine Remoting Client Working-{0}. Execute PING!", ++iterations);

                m_trinity?.Ping();

                using var serverHelloMessage = new PingMessagePayloadWriter(@"Hello from Server");

                m_trinity?.ExternalClientPing(serverHelloMessage);

                await Task.Delay(TimeSpan.FromSeconds(30), cancellationToken);
            }
        }