2023-07-19 12:30:39 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
|
2023-07-21 13:11:56 -07:00
|
|
|
|
namespace Cauldron.Core;
|
2023-07-19 12:30:39 -07:00
|
|
|
|
|
2023-07-21 13:11:56 -07:00
|
|
|
|
public class CauldronWriter
|
2023-07-19 12:30:39 -07:00
|
|
|
|
{
|
|
|
|
|
|
private Func<object, Task> OutputFunc { get; set; }
|
|
|
|
|
|
|
2023-07-21 13:11:56 -07:00
|
|
|
|
public CauldronWriter(Func<object, Task> outputFunc)
|
2023-07-19 12:30:39 -07:00
|
|
|
|
{
|
|
|
|
|
|
this.OutputFunc = outputFunc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-07-24 15:56:12 -07:00
|
|
|
|
public async Task Output(object obj)
|
2023-07-19 12:30:39 -07:00
|
|
|
|
{
|
|
|
|
|
|
await this.OutputFunc(obj);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|