mirror of
https://github.com/actions/runner.git
synced 2026-03-12 17:57:13 -04:00
Add DAP protocol message types and service interfaces
This commit is contained in:
1134
src/Runner.Worker/Dap/DapMessages.cs
Normal file
1134
src/Runner.Worker/Dap/DapMessages.cs
Normal file
File diff suppressed because it is too large
Load Diff
32
src/Runner.Worker/Dap/IDapDebugSession.cs
Normal file
32
src/Runner.Worker/Dap/IDapDebugSession.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GitHub.Runner.Common;
|
||||
|
||||
namespace GitHub.Runner.Worker.Dap
|
||||
{
|
||||
public enum DapSessionState
|
||||
{
|
||||
WaitingForConnection,
|
||||
Initializing,
|
||||
Ready,
|
||||
Paused,
|
||||
Running,
|
||||
Terminated
|
||||
}
|
||||
|
||||
[ServiceLocator(Default = typeof(DapDebugSession))]
|
||||
public interface IDapDebugSession : IRunnerService
|
||||
{
|
||||
bool IsActive { get; }
|
||||
DapSessionState State { get; }
|
||||
void SetDapServer(IDapServer server);
|
||||
Task WaitForHandshakeAsync(CancellationToken cancellationToken);
|
||||
Task OnStepStartingAsync(IStep step, IExecutionContext jobContext, bool isFirstStep, CancellationToken cancellationToken);
|
||||
void OnStepCompleted(IStep step);
|
||||
void OnJobCompleted();
|
||||
void CancelSession();
|
||||
void HandleClientConnected();
|
||||
void HandleClientDisconnected();
|
||||
Task HandleMessageAsync(string messageJson, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
18
src/Runner.Worker/Dap/IDapServer.cs
Normal file
18
src/Runner.Worker/Dap/IDapServer.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using GitHub.Runner.Common;
|
||||
|
||||
namespace GitHub.Runner.Worker.Dap
|
||||
{
|
||||
[ServiceLocator(Default = typeof(DapServer))]
|
||||
public interface IDapServer : IRunnerService
|
||||
{
|
||||
void SetSession(IDapDebugSession session);
|
||||
Task StartAsync(int port, CancellationToken cancellationToken);
|
||||
Task WaitForConnectionAsync(CancellationToken cancellationToken);
|
||||
Task StopAsync();
|
||||
void SendMessage(ProtocolMessage message);
|
||||
void SendEvent(Event evt);
|
||||
void SendResponse(Response response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user